I need way to get an array of names of all decorated methods created in a draper decorator instance.
If i have two classes like:
class A
def foo
end
end
class ADecorator < Draper::Decorator
def bar
end
def hi
end
end
Then i want to do something like:
decorated = ADecorator.decorate(A.new)
decorated.decorated_methods # => [:bar, :hi]
Closest to this is ruby's builtin instance_methods
method but it returns both base object methods and decorator methods (In this example returns [:foo, :bar, :hi]
)