mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-07-18 00:00:50 -04:00
Compare commits
2 Commits
0c8398b3db
...
4292644870
Author | SHA1 | Date | |
---|---|---|---|
|
4292644870 | ||
|
2e11ee5b32 |
@ -48,7 +48,7 @@ module HTTPX
|
|||||||
end
|
end
|
||||||
|
|
||||||
def plugin(pl, options = nil, &blk)
|
def plugin(pl, options = nil, &blk)
|
||||||
klass = is_a?(Session) ? self.class : Session
|
klass = is_a?(S) ? self.class : Session
|
||||||
klass = Class.new(klass)
|
klass = Class.new(klass)
|
||||||
klass.instance_variable_set(:@default_options, klass.default_options.merge(default_options))
|
klass.instance_variable_set(:@default_options, klass.default_options.merge(default_options))
|
||||||
klass.plugin(pl, options, &blk).new
|
klass.plugin(pl, options, &blk).new
|
||||||
@ -58,7 +58,7 @@ module HTTPX
|
|||||||
# :nocov:
|
# :nocov:
|
||||||
def plugins(pls)
|
def plugins(pls)
|
||||||
warn ":#{__method__} is deprecated, use :plugin instead"
|
warn ":#{__method__} is deprecated, use :plugin instead"
|
||||||
klass = is_a?(Session) ? self.class : Session
|
klass = is_a?(S) ? self.class : Session
|
||||||
klass = Class.new(klass)
|
klass = Class.new(klass)
|
||||||
klass.instance_variable_set(:@default_options, klass.default_options.merge(default_options))
|
klass.instance_variable_set(:@default_options, klass.default_options.merge(default_options))
|
||||||
klass.plugins(pls).new
|
klass.plugins(pls).new
|
||||||
@ -82,7 +82,7 @@ module HTTPX
|
|||||||
end
|
end
|
||||||
|
|
||||||
def branch(options, &blk)
|
def branch(options, &blk)
|
||||||
return self.class.new(options, &blk) if is_a?(Session)
|
return self.class.new(options, &blk) if is_a?(S)
|
||||||
|
|
||||||
Session.new(options, &blk)
|
Session.new(options, &blk)
|
||||||
end
|
end
|
||||||
|
@ -351,4 +351,7 @@ module HTTPX
|
|||||||
# :nocov:
|
# :nocov:
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# session may be overridden by certain adapters.
|
||||||
|
S = Session
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user