Use define_method rather than eval.

This commit is contained in:
Andy Brody 2014-11-27 22:15:53 -05:00
parent 5b5d185626
commit 04f1e80a7f
1 changed files with 3 additions and 5 deletions

View File

@ -56,11 +56,9 @@ if @verb
end
POSSIBLE_VERBS.each do |m|
eval <<-end_eval
def #{m}(path, *args, &b)
r[path].#{m}(*args, &b)
end
end_eval
define_method(m.to_sym) do |path, *args, &b|
r[path].public_send(m.to_sym, *args, &b)
end
end
def method_missing(s, * args, & b)