mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-08-10 00:01:27 -04:00
replaced define_method with class_eval in options
This commit is contained in:
parent
138bfd79ac
commit
1aef976b57
@ -3,9 +3,11 @@
|
||||
module HTTPX
|
||||
module Chainable
|
||||
%i[head get post put delete trace options connect patch].each do |meth|
|
||||
define_method meth do |*uri, **options|
|
||||
request(meth, uri, **options)
|
||||
end
|
||||
class_eval(<<-MOD, __FILE__, __LINE__ + 1)
|
||||
def #{meth}(*uri, **options)
|
||||
request(:#{meth}, uri, **options)
|
||||
end
|
||||
MOD
|
||||
end
|
||||
|
||||
def request(verb, uri, **options)
|
||||
|
Loading…
x
Reference in New Issue
Block a user