Skip to content

Instantly share code, notes, and snippets.

@fbernier
Last active December 12, 2015 04:38
Show Gist options
  • Save fbernier/4715561 to your computer and use it in GitHub Desktop.
Save fbernier/4715561 to your computer and use it in GitHub Desktop.
# Any difference between:
[:db_create, :db_drop, :db_list].each do |cmd|
#THIS:
define_method(cmd) do |*args|
NoBrainer.run { RethinkDB::RQL.send(cmd, *args) }
end
# OR THIS
class_eval <<-RUBY, __FILE__, __LINE__ + 1
def #{cmd}(*args)
NoBrainer.run { RethinkDB::RQL.#{cmd}(*args) }
end
RUBY
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment