Skip to content

Instantly share code, notes, and snippets.

@paul
Created July 29, 2008 23:01
Show Gist options
  • Save paul/3194 to your computer and use it in GitHub Desktop.
Save paul/3194 to your computer and use it in GitHub Desktop.
class Foo
class_eval <<-EOS, __FILE__, __LINE__
def bar=(*args, &block)
puts args.inspect
end
EOS
end
Foo.new.bar= 1
% ruby evaltest.rb
[1]
% /usr/local/bin/rbx evaltest.rb
[1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment