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:
parent
5b5d185626
commit
04f1e80a7f
1 changed files with 3 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue