lib/vkontakte_api/configuration.rb in vkontakte_api-1.0.1 vs lib/vkontakte_api/configuration.rb in vkontakte_api-1.0.2
- old
+ new
@@ -4,21 +4,35 @@
# 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, :faraday_options, :logger, :log_requests, :log_errors, :log_responses]
+ OPTION_NAMES = [
+ :app_id,
+ :app_secret,
+ :redirect_uri,
+ :adapter,
+ :http_verb,
+ :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
alias_method :log_responses?, :log_responses
# Default HTTP adapter.
DEFAULT_ADAPTER = Faraday.default_adapter
+ # Default HTTP verb for API methods.
+ DEFAULT_HTTP_VERB = :get
+
# Logger default options.
DEFAULT_LOGGER_OPTIONS = {
:requests => true,
:errors => true,
:responses => false
@@ -36,9 +50,10 @@
end
# Reset all configuration options to defaults.
def reset
@adapter = DEFAULT_ADAPTER
+ @http_verb = DEFAULT_HTTP_VERB
@faraday_options = {}
@logger = ::Logger.new(STDOUT)
@log_requests = DEFAULT_LOGGER_OPTIONS[:requests]
@log_errors = DEFAULT_LOGGER_OPTIONS[:errors]
@log_responses = DEFAULT_LOGGER_OPTIONS[:responses]