I want to get all the methods that are defined directly on the class
Here is what I currently do:
class Mine
def immediate
end
(instance_methods - ancestors.second.instance_methods)
# [:immediate]
end
Is there a better way?
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.
does this look good? or how do you like to write it? something like Mine.my_instance_methods? 🙂