In object-oriented programming and your example, @obj1 is not being
passed to perform_sanity_check, it is the receiver object, the
object being asked to execute its perform_sanity_check method. In a
way, you are sending a message to the object @obj, requesting that it
execute one of its methods.
In object-oriented programming and your example, @obj1 is not being
passed to perform_sanity_check, it is the receiver object, the
object being asked to execute its perform_sanity_check method. In a
way, you are sending a message to the object @obj, requesting that it
execute one of its methods.
Will the instance method perform_sanity_check have access to @obj1
attributes?
yes, with
self.attribute
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group, send
On Mar 15, 6:22 am, Amita Bhatkhande rails-mailing-l...@andreas-
s.net wrote:
If we are calling an instance method on particular instance of an object
as:
@obj1.perform_sanity_check(@obj2)
Will the instance method perform_sanity_check have access to @obj1
attributes?
Yes.
Fred
How do
4 matches
Mail list logo