mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-07-19 00:00:47 -04:00
Compare commits
No commits in common. "42926448704ee1b74e0b9f9c69ebe746e96676da" and "0c8398b3dbf6f40e7417e220c05a6649a4db76d8" have entirely different histories.
4292644870
...
0c8398b3db
@ -48,7 +48,7 @@ module HTTPX
|
||||
end
|
||||
|
||||
def plugin(pl, options = nil, &blk)
|
||||
klass = is_a?(S) ? self.class : Session
|
||||
klass = is_a?(Session) ? 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
|
||||
@ -58,7 +58,7 @@ module HTTPX
|
||||
# :nocov:
|
||||
def plugins(pls)
|
||||
warn ":#{__method__} is deprecated, use :plugin instead"
|
||||
klass = is_a?(S) ? self.class : Session
|
||||
klass = is_a?(Session) ? self.class : Session
|
||||
klass = Class.new(klass)
|
||||
klass.instance_variable_set(:@default_options, klass.default_options.merge(default_options))
|
||||
klass.plugins(pls).new
|
||||
@ -82,7 +82,7 @@ module HTTPX
|
||||
end
|
||||
|
||||
def branch(options, &blk)
|
||||
return self.class.new(options, &blk) if is_a?(S)
|
||||
return self.class.new(options, &blk) if is_a?(Session)
|
||||
|
||||
Session.new(options, &blk)
|
||||
end
|
||||
|
@ -351,7 +351,4 @@ module HTTPX
|
||||
# :nocov:
|
||||
end
|
||||
end
|
||||
|
||||
# session may be overridden by certain adapters.
|
||||
S = Session
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user