Module: RestApiClient::Configuration
- Included in:
- Client
- Defined in:
- lib/rest_api_client/configuration.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/rest_api_client/configuration.rb', line 6 def url @url end |
Instance Method Details
#default_middleware_config ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rest_api_client/configuration.rb', line 14 def default_middleware_config lambda {|faraday| faraday.request :json faraday.request :url_encoded faraday.headers[:Accept] = 'application/json' faraday.headers['Content-Type'] = 'application/json' faraday.response :logger, logger #faraday.options[:timeout] = 300 faraday.adapter Faraday.default_adapter } end |
#default_options ⇒ Object
8 9 10 11 12 |
# File 'lib/rest_api_client/configuration.rb', line 8 def { url: url } end |
#logger ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/rest_api_client/configuration.rb', line 26 def logger log_output = $stdout if defined? Rails log_out = 'logs/api_logs.txt' unless Rails.env.development? end logger = Logger.new log_output logger.level = Logger::INFO logger end |