1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00

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

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)