Reputation: 24118
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?
Upvotes: 4
Views: 202
Reputation: 2349
Mine.instance_methods false
does this look good? or how do you like to write it? something like Mine.my_instance_methods? :)
Upvotes: 6