lib/httpx/chainable.rb in httpx-0.24.7 vs lib/httpx/chainable.rb in httpx-1.0.0
- old
+ new
@@ -25,22 +25,10 @@
def request(*args, **options)
branch(default_options).request(*args, **options)
end
- # :nocov:
- def timeout(**args)
- warn ":#{__method__} is deprecated, use :with_timeout instead"
- with(timeout: args)
- end
-
- def headers(headers)
- warn ":#{__method__} is deprecated, use :with_headers instead"
- with(headers: headers)
- end
- # :nocov:
-
def accept(type)
with(headers: { "accept" => String(type) })
end
def wrap(&blk)
@@ -51,20 +39,9 @@
klass = is_a?(S) ? self.class : Session
klass = Class.new(klass)
klass.instance_variable_set(:@default_options, klass.default_options.merge(default_options))
klass.plugin(pl, options, &blk).new
end
-
- # deprecated
- # :nocov:
- def plugins(pls)
- warn ":#{__method__} is deprecated, use :plugin instead"
- klass = is_a?(S) ? self.class : Session
- klass = Class.new(klass)
- klass.instance_variable_set(:@default_options, klass.default_options.merge(default_options))
- klass.plugins(pls).new
- end
- # :nocov:
def with(options, &blk)
branch(default_options.merge(options), &blk)
end