Compare commits

..

No commits in common. "42926448704ee1b74e0b9f9c69ebe746e96676da" and "0c8398b3dbf6f40e7417e220c05a6649a4db76d8" have entirely different histories.

2 changed files with 3 additions and 6 deletions

View File

@ -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

View File

@ -351,7 +351,4 @@ module HTTPX
# :nocov:
end
end
# session may be overridden by certain adapters.
S = Session
end