ruby send vs __send__
Posted
by
jaydel
on Stack Overflow
See other posts from Stack Overflow
or by jaydel
Published on 2011-01-11T13:48:02Z
Indexed on
2011/01/11
13:54 UTC
Read the original article
Hit count: 317
I understand the concept of some_instance.send but I'm trying to figure out why you can call this both ways? The Ruby Koans imply that there is some reason beyond providing lots of different ways to do the same thing and I'm wrestling with figuring this out. Here are the two examples of usage more concretely
class Foo def bar? true end end
foo = Foo.new foo.send(:bar?) foo.send(:bar?)
Anyone have any idea about this?
thanks in advance!
© Stack Overflow or respective owner