Inspecting an Object
You can find the public methods an object can respond to using either the methods or public_methods methods, which return an array of symbols:
class Foo
def bar; 42; end
end
f = Foo.new
def f.yay; 17; end
p f.methods.sort
#=> [:!, :!=, :!~, :<=>, :==, :===, :=...