I realized it is possible to have # in a definition:
def Foo#bar
"blah blah"
end
But I am not sure what it means. I expected an instance method bar defined on class Foo, but that does not seem to be the case. What does it mean?
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.
#begins a comment in ruby. You are simply defining a method calledFoo.(Note that
Foo#baris commonly used to denote “the instance methodbarof classFoo“, but it is not a feature of Ruby syntax!)