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
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
send to access private members
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password