Sha256: cc74acc1c01eec8ad9983709ba7b9872b894145a250381c441c34fb944bf9e9e

Contents?: true

Size: 594 Bytes

Versions: 4

Compression:

Stored size: 594 Bytes

Contents

# frozen_string_literal: true

module Faraday
  # RequestOptions contains the configurable properties for a Faraday request.
  class RequestOptions < Options.new(:params_encoder, :proxy, :bind,
                                     :timeout, :open_timeout, :write_timeout,
                                     :boundary, :oauth, :context, :on_data)

    def []=(key, value)
      if key && key.to_sym == :proxy
        super(key, value ? ProxyOptions.from(value) : nil)
      else
        super(key, value)
      end
    end

    def stream_response?
      on_data.is_a?(Proc)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
faraday-0.16.2 lib/faraday/options/request_options.rb
faraday-0.16.1 lib/faraday/options/request_options.rb
faraday-0.16.0 lib/faraday/options/request_options.rb
faraday-1.0.0.pre.rc1 lib/faraday/options/request_options.rb