Thanks Arun. I am also from India. Do you know any company who is hiring
ruby developers? If you do have, would you refer me ? This is my account
- User Arup Rakshit - Stack Overflow .
In Ruby they are treated differently, there's a syntax sugar for methods
ending with the "=" character.
So,
self.setter=(value)
And
self.setter = value
Are the same.
There's other internal differences. One of them I'm aware of is, on setters
the returned values is always the value of the assignment (right value) not
the value returned by the method.
Abinoam Jr.
···
Em 13/01/2014 05:25, "Marc Heiler" <lists@ruby-forum.com> escreveu:
This also confuses me.
> setter return right hand value rather then normal return value.
Isn't that truly a logical thing? After all, it is a method call. I can
use setters without the =
setter return right hand value rather then normal return value.
Isn't that truly a logical thing? After all, it is a method call. I can
use setters without the =
def set_foo(i) @foo = i
end
Yes, of-course. But in that case `set_foo` will not be called as
**setter**. It is simply a method which is setting/assigning the value
to the instance variable @foo.
In Ruby they are treated differently, there's a syntax sugar for methods
ending with the "=" character.
There's other internal differences. One of them I'm aware of is, on
setters
the returned values is always the value of the assignment (right value)
not
the value returned by the method.