We've expanded our news coverage and improved our search! Visit news.oreilly.com for the latest or search for all things across O'Reilly!
advertisement

Article:
  Ruby/Tk Primer: Creating a cron GUI Interface with Ruby/Tk
Subject:   Answer to the self.puts dilema
Date:   2004-07-19 18:23:49
From:   wkaha@yahoo.com
Response to: Answer to the self.puts dilema

IMHO There is no need to use self.hello.
I've tried without and it works.
Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Answer to the self.puts dilema
    2004-07-19 20:06:35  Christopher Roach [Reply | View]

    There really isn't any reason for the self.hello call other than to prove the point that a private method (hello, in this case) cannot be prefaced with a reference of any kind, even a reference to the object in which the private method resides. So, yes, you could try out the code without the self.hello call, but that would defeat the purpose of the example.

    The example is absolutely useless, I know, but it was created purely for pedagogical reasons rather than utility.