I want to call instance_eval
on this class:
class A
attr_reader :att
end
passing this method b
:
class B
def b(*args)
att
end
end
but this is happening:
a = A.new
bb = B.new
a.instance_eval(&bb.method(:b)) # NameError: undefined local variable or method `att' for #<B:0x007fb39ad0d568>
When b
is a block it works, but b
as a method isn't working. How can I make it work?