There is apparently a ruby method called method and I can’t find any docs or examples on it so far. Could someone please post a few useful annotated examples?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One of the best uses of the bound method object returned by
Object#methodis for blocks. The return result of that method can be converted to a block argument. Imagine you have:Then you could do this
or when you are within the convertor
which IMO is more elegant than the explicit block creation syntax. It also supports
to_procso you can do thisand then in
some_objectyou can do