Topic: Why use "self." ?

I learned that self. is used to define class methods. But some codes uses self. before local variables. How does it work?

Re: Why use "self." ?

self.variable references an instance variable of the object.

It is implied, but it is often useful for clarity.

In method two below, method one is called twice. The second call is arguably clearer, especially with large classes.

class Thing
  def one
    # logic ...
  end

  def two
    one
    self.one
  end
end

Toby Hede
===================================================
FiniteStateMachine - Software Development for Social Networks
===================================================

Re: Why use "self." ?

Thanks.