lib/httpx/chainable.rb in httpx-0.1.0 vs lib/httpx/chainable.rb in httpx-0.2.0

- old
+ new

@@ -30,22 +30,22 @@ klass.instance_variable_set(:@default_options, klass.default_options.merge(default_options)) klass.plugins(plugins).new end alias_method :plugins, :plugin - def with(options) - branch(default_options.merge(options)) + def with(options, &blk) + branch(default_options.merge(options), &blk) end private def default_options @options || Options.new end # :nodoc: - def branch(options) - return self.class.new(options) if is_a?(Client) - Client.new(options) + def branch(options, &blk) + return self.class.new(options, &blk) if is_a?(Client) + Client.new(options, &blk) end end end