lib/httpx/chainable.rb in httpx-0.3.1 vs lib/httpx/chainable.rb in httpx-0.4.0
- old
+ new
@@ -27,11 +27,11 @@
def wrap(&blk)
branch(default_options).wrap(&blk)
end
def plugin(*plugins)
- klass = is_a?(Client) ? self.class : Client
+ 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(plugins).new
end
alias_method :plugins, :plugin
@@ -46,10 +46,11 @@
@options || Options.new
end
# :nodoc:
def branch(options, &blk)
- return self.class.new(options, &blk) if is_a?(Client)
- Client.new(options, &blk)
+ return self.class.new(options, &blk) if is_a?(Session)
+
+ Session.new(options, &blk)
end
end
end