lib/vkontakte_api/configuration.rb in vkontakte_api-1.0.rc2 vs lib/vkontakte_api/configuration.rb in vkontakte_api-1.0.rc3
- old
+ new
@@ -4,11 +4,11 @@
# General configuration module.
#
# @note `VkontakteApi::Configuration` extends `VkontakteApi` so these methods should be called from the latter.
module Configuration
# Available options.
- OPTION_NAMES = [:app_id, :app_secret, :redirect_uri, :adapter, :logger, :log_requests, :log_errors, :log_responses]
+ OPTION_NAMES = [:app_id, :app_secret, :redirect_uri, :adapter, :faraday_options, :logger, :log_requests, :log_errors, :log_responses]
attr_accessor *OPTION_NAMES
alias_method :log_requests?, :log_requests
alias_method :log_errors?, :log_errors
@@ -35,14 +35,15 @@
self
end
# Reset all configuration options to defaults.
def reset
- @adapter = DEFAULT_ADAPTER
- @logger = ::Logger.new(STDOUT)
- @log_requests = DEFAULT_LOGGER_OPTIONS[:requests]
- @log_errors = DEFAULT_LOGGER_OPTIONS[:errors]
- @log_responses = DEFAULT_LOGGER_OPTIONS[:responses]
+ @adapter = DEFAULT_ADAPTER
+ @faraday_options = {}
+ @logger = ::Logger.new(STDOUT)
+ @log_requests = DEFAULT_LOGGER_OPTIONS[:requests]
+ @log_errors = DEFAULT_LOGGER_OPTIONS[:errors]
+ @log_responses = DEFAULT_LOGGER_OPTIONS[:responses]
end
# When this module is extended, set all configuration options to their default values.
def self.extended(base)
base.reset