Class: Binking::Config
- Inherits:
-
Object
- Object
- Binking::Config
- Defined in:
- lib/binking/config.rb
Constant Summary collapse
- DEFAULT_HOST =
"https://api.binking.io"
Instance Attribute Summary collapse
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#cache ⇒ Object
Returns the value of attribute cache.
-
#cache_expires_in ⇒ Object
Returns the value of attribute cache_expires_in.
-
#host ⇒ Object
Returns the value of attribute host.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#request_options ⇒ Object
Returns the value of attribute request_options.
-
#sandbox ⇒ Object
Returns the value of attribute sandbox.
Instance Method Summary collapse
- #configured? ⇒ Boolean
-
#initialize(api_token: nil, host: DEFAULT_HOST, sandbox: false, cache: nil, cache_expires_in: 2592000, logger: nil, request_options: {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(api_token: nil, host: DEFAULT_HOST, sandbox: false, cache: nil, cache_expires_in: 2592000, logger: nil, request_options: {}) ⇒ Config
Returns a new instance of Config.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/binking/config.rb', line 9 def initialize(api_token: nil, host: DEFAULT_HOST, sandbox: false, cache: nil, cache_expires_in: 2592000, logger: nil, request_options: {}) @api_token = api_token @host = host @sandbox = sandbox @cache = cache @cache_expires_in = cache_expires_in @logger = logger @request_options = end |
Instance Attribute Details
#api_token ⇒ Object
Returns the value of attribute api_token.
7 8 9 |
# File 'lib/binking/config.rb', line 7 def api_token @api_token end |
#cache ⇒ Object
Returns the value of attribute cache.
7 8 9 |
# File 'lib/binking/config.rb', line 7 def cache @cache end |
#cache_expires_in ⇒ Object
Returns the value of attribute cache_expires_in.
7 8 9 |
# File 'lib/binking/config.rb', line 7 def cache_expires_in @cache_expires_in end |
#host ⇒ Object
Returns the value of attribute host.
7 8 9 |
# File 'lib/binking/config.rb', line 7 def host @host end |
#logger ⇒ Object
Returns the value of attribute logger.
7 8 9 |
# File 'lib/binking/config.rb', line 7 def logger @logger end |
#request_options ⇒ Object
Returns the value of attribute request_options.
7 8 9 |
# File 'lib/binking/config.rb', line 7 def @request_options end |
#sandbox ⇒ Object
Returns the value of attribute sandbox.
7 8 9 |
# File 'lib/binking/config.rb', line 7 def sandbox @sandbox end |
Instance Method Details
#configured? ⇒ Boolean
25 26 27 |
# File 'lib/binking/config.rb', line 25 def configured? [api_token, host].all? { |param| !param.nil? && !param.empty? } end |