A
Adam Anderson
http://pastie.caboo.se/114839
Can anyone tell me why this wouldn't/shouldn't/should work? I don't
want to pull out all of my hair trying to figure this out if it isn't
even possible.
Thanks,
Adam
class Calculator
def evaluate(&script)
self.instance_eval(&script)
end
def two
"2"
end
end
class Foo
def hi
puts "hi"
end
def howdy
Calculator.new.evaluate do
puts two
hi
end
end
end
Foo.new.howdy
Attachments:
http://www.ruby-forum.com/attachment/920/w.rb
Can anyone tell me why this wouldn't/shouldn't/should work? I don't
want to pull out all of my hair trying to figure this out if it isn't
even possible.
Thanks,
Adam
class Calculator
def evaluate(&script)
self.instance_eval(&script)
end
def two
"2"
end
end
class Foo
def hi
puts "hi"
end
def howdy
Calculator.new.evaluate do
puts two
hi
end
end
end
Foo.new.howdy
Attachments:
http://www.ruby-forum.com/attachment/920/w.rb