aboutsummaryrefslogtreecommitdiffstats
path: root/lib/iev_api/configuration.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/iev_api/configuration.rb')
-rw-r--r--lib/iev_api/configuration.rb59
1 files changed, 0 insertions, 59 deletions
diff --git a/lib/iev_api/configuration.rb b/lib/iev_api/configuration.rb
deleted file mode 100644
index b445da795..000000000
--- a/lib/iev_api/configuration.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-module IevApi
- module Configuration
- VALID_OPTIONS_KEYS = [
- :account,
- :auth_token,
- :secure,
- :connection_options,
- :adapter,
- :user_agent,
- :middleware]
-
- attr_accessor *VALID_OPTIONS_KEYS
-
- DEFAULT_ADAPTER = :net_http
- DEFAULT_USER_AGENT = "IEV Ruby Gem Api"
- DEFAULT_CONNECTION_OPTIONS = {}
- DEFAULT_MIDDLEWARE = [
- Faraday::Request::UrlEncoded,
- IevApi::Middleware::RaiseResponseError,
- Faraday::Request::Multipart,
- FaradayMiddleware::Mashify,
- #FaradayMiddleware::Caching,
- FaradayMiddleware::FollowRedirects,
- FaradayMiddleware::ParseJson,
- IevApi::Middleware::RaiseServerError,
- IevApi::Middleware::CustomParser
- ]
-
- def self.extended(base)
- base.reset
- end
-
- def configure(options={})
- @account = options[:account] if options.has_key?(:account)
- @auth_token = options[:auth_token] if options.has_key?(:auth_token)
- @secure = options[:secure] if options.has_key?(:secure)
- @middleware = options[:middleware] if options.has_key?(:middleware)
- yield self if block_given?
- self
- end
-
- def options
- options = {}
- VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}
- options
- end
-
- def reset
- @account = nil
- @auth_token = nil
- @secure = false
- @adapter = DEFAULT_ADAPTER
- @user_agent = DEFAULT_USER_AGENT
- @connection_options = DEFAULT_CONNECTION_OPTIONS
- @middleware = DEFAULT_MIDDLEWARE
- end
-
- end
-end