Alternate version here (Under the same name) with cleaner api to meta-methods
A few helpers for manipulating methods on an instance of an object.
gem 'meta_instance'
With a class:
class Foo
include MetaInstance
def bar; "bar"; end
end
You can do this:
f = Foo.new
f.bar
# => "bar"
f.instance_define(:bar){ "foo" }
f.bar
# => "foo"
Foo.new.bar
# => "bar"
See Specs for examples :-)