module TelphinApi::Configuration
General configuration module.
@note `TelphinApi::Configuration` extends `TelphinApi` so these methods should be called from the latter.
Constants
Public Class Methods
extended(base)
click to toggle source
When this module is extended, set all configuration options to their default values.
# File lib/telphin_api/configuration.rb, line 71 def self.extended(base) base.reset end
Public Instance Methods
configure() { |self| ... }
click to toggle source
A global configuration set via the block. @example
TelphinApi.configure do |config| config.adapter = :net_http config.logger = Rails.logger end
# File lib/telphin_api/configuration.rb, line 53 def configure yield self if block_given? self end
reset()
click to toggle source
Reset all configuration options to defaults.
# File lib/telphin_api/configuration.rb, line 59 def reset @site = DEFAULT_URL @adapter = DEFAULT_ADAPTER @faraday_options = {} @max_retries = DEFAULT_MAX_RETRIES @logger = ::Logger.new(STDOUT) @log_requests = DEFAULT_LOGGER_OPTIONS[:requests] @log_errors = DEFAULT_LOGGER_OPTIONS[:errors] @log_responses = DEFAULT_LOGGER_OPTIONS[:responses] end