S
Sur
[Note: parts of this message were removed to make it a legal post.]
Hi Everyone,
I am not sure if I have seen it being used earlier or probably I don't know
how to use it.
when I define function(s) inside a function within the main object, it
works...
def person
def author
p "I am author"
end
def reader
p "I am reader"
end
end
Now, if I call
person.author # => I am author
person.reader # => I am reader
And it works fine with any hierarchy.
The same thing doesn't seem to work inside a class.
Any explanation ?
Thanks!
Hi Everyone,
I am not sure if I have seen it being used earlier or probably I don't know
how to use it.
when I define function(s) inside a function within the main object, it
works...
def person
def author
p "I am author"
end
def reader
p "I am reader"
end
end
Now, if I call
person.author # => I am author
person.reader # => I am reader
And it works fine with any hierarchy.
The same thing doesn't seem to work inside a class.
Any explanation ?
Thanks!