Class: Evvnt::Configuration
- Inherits:
-
Object
- Object
- Evvnt::Configuration
- Defined in:
- lib/evvnt/configuration.rb
Overview
Handles configuration for the gem
Constant Summary collapse
- ENVIRONMENTS =
%i[sandbox live].freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_secret ⇒ Object
Returns the value of attribute api_secret.
- #debug ⇒ Object
- #logger ⇒ Object
Instance Method Summary collapse
- #environment ⇒ Object
- #environment=(value) ⇒ Object
-
#initialize(&block) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(&block) ⇒ Configuration
Returns a new instance of Configuration.
26 27 28 |
# File 'lib/evvnt/configuration.rb', line 26 def initialize(&block) instance_eval(&block) if block_given? end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
20 21 22 |
# File 'lib/evvnt/configuration.rb', line 20 def api_key @api_key end |
#api_secret ⇒ Object
Returns the value of attribute api_secret.
24 25 26 |
# File 'lib/evvnt/configuration.rb', line 24 def api_secret @api_secret end |
#debug ⇒ Object
49 50 51 |
# File 'lib/evvnt/configuration.rb', line 49 def debug defined?(@debug) ? @debug : @debug = false end |
#logger ⇒ Object
43 44 45 |
# File 'lib/evvnt/configuration.rb', line 43 def logger @logger ||= Logger.new($stdout) end |
Instance Method Details
#environment ⇒ Object
37 38 39 |
# File 'lib/evvnt/configuration.rb', line 37 def environment @environment ||= :sandbox end |
#environment=(value) ⇒ Object
32 33 34 35 |
# File 'lib/evvnt/configuration.rb', line 32 def environment=(value) raise ArgumentError unless value.to_sym.in?(ENVIRONMENTS) @environment = value end |