Skip to content

Instantly share code, notes, and snippets.

@paul
Created July 29, 2008 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paul/3196 to your computer and use it in GitHub Desktop.
Save paul/3196 to your computer and use it in GitHub Desktop.
% 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