[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

send to access private members

David Weldon

1/6/2007 1:06:00 AM

I'm a confused about why the following code works:

class Foo
private
def hello
puts "hello"
end
end
f = Foo.new
f.send(:hello)

whereas
f.hello will obviously fail.

I have tried this with private member setting as well and it also works.
Is send supposed to operate this way? The rdoc for it don't seem to
mention this. Thanks!

--
Posted via http://www.ruby-....

1 Answer

dblack

1/6/2007 1:21:00 AM

0