Skip to content

Instantly share code, notes, and snippets.

@eltiare
Created November 29, 2008 06:07
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 eltiare/30192 to your computer and use it in GitHub Desktop.
Save eltiare/30192 to your computer and use it in GitHub Desktop.
#This works:
drop_class.class_eval do
allowed_methods.each do |am|
define_method am do
@object.send(am)
end
end
end
#This doesn't:
drop_class.class_eval {
allowed_methods.each { |am|
define_method am { @object.send(am) }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment