Created
July 29, 2008 23:06
-
-
Save paul/3196 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% cat evaltest.rb | |
class Zoo | |
def bar=(a) | |
puts a.inspect | |
end | |
end | |
class Foo | |
def initialize | |
@baz = Zoo.new | |
end | |
class_eval <<-EOS, __FILE__, __LINE__ | |
def bar=(*args, &block) | |
@baz.bar=(*args, &block) | |
end | |
EOS | |
end | |
Foo.new.bar= 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment