Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Class(y) - <b>self</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 self
 Reference to current object in methods
------------------------------------------------------------------------------

 Description:

    self is a local instance variable which is automatically defined in
    all methods.  It contains a reference to the current object, ie. the
    object which received the message which invoked the current method.

    For example, a statement such as obj:open() will normally invoke
    the open() method.  Inside that method, the self variable will
    contain a reference to the same object referred to by obj.

    Since self is typically used heavily inside methods, a special
    operator, the double-colon (::) has been provided as a shorthand
    for sending message to self.  See the :: entry for more
    information.

See Also: ::

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson