Sha256: 1201e40d741b53f66421a7fd6e704d4129d6e13cd61da3debd25884644008b9b
Contents?: true
Size: 926 Bytes
Versions: 4
Compression:
Stored size: 926 Bytes
Contents
# frozen_string_literal: true module Aitch class Configuration # Set proxy. attr_accessor :proxy # Set request timeout. attr_accessor :timeout # Set default headers. attr_accessor :default_headers # Set follow redirect. attr_accessor :follow_redirect # Set redirection limit. attr_accessor :redirect_limit # Set the user agent. attr_accessor :user_agent # Set the logger. attr_accessor :logger # Set the base url. attr_accessor :base_url def initialize @timeout = 10 @redirect_limit = 5 @follow_redirect = true @user_agent = "Aitch/#{Aitch::VERSION} (http://rubygems.org/gems/aitch)" @default_headers = {} @base_url = nil end def to_h instance_variables.each_with_object({}) do |name, buffer| buffer[name.to_s.tr("@", "").to_sym] = instance_variable_get(name) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
aitch-2.0.0 | lib/aitch/configuration.rb |
aitch-1.2.2 | lib/aitch/configuration.rb |
aitch-1.2.1 | lib/aitch/configuration.rb |
aitch-1.2.0 | lib/aitch/configuration.rb |