Reputation: 3908
How do i list all the methods of an object in Ruby which are not in-built methods, if I do Fruit.new.methods it will list all the methods which includes user defined methods which are declared in the class Fruit,I want to see only the methods which are written in class Fruit.
Upvotes: 1
Views: 1518
Reputation: 5231
myFruit.public_methods(false)
returns the list of public methods accessible to myFruit
with inherited methods excluded.
Upvotes: 3