Is there a way to capture the return value from a method that was
invoked with ‘send’? Thanks.
... doug
Is there a way to capture the return value from a method that was
invoked with ‘send’? Thanks.
... doug
What do you mean? The return value of send is the return value of the
called method.
def f
123
end
p send(:f)
The return value of send is the return value of the
called method.
You answered my question. That is exactly what I didn’t know. That is,
while I knew that a method may return a value, I didn’t know that if a
method is invoked by send, send will return the value returned by the
method. Thanks. I’m squared away.
... doug
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs