Class: Vertpig::Configuration
- Inherits:
-
Object
- Object
- Vertpig::Configuration
- Includes:
- Singleton
- Defined in:
- lib/vertpig/configuration.rb
Constant Summary collapse
- @@defaults =
{ key: ENV['vertpig_api_key'], secret: ENV['vertpig_api_secret'] }
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#secret ⇒ Object
Returns the value of attribute secret.
Class Method Summary collapse
Instance Method Summary collapse
- #auth ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reset ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 |
# File 'lib/vertpig/configuration.rb', line 18 def initialize reset end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
7 8 9 |
# File 'lib/vertpig/configuration.rb', line 7 def key @key end |
#secret ⇒ Object
Returns the value of attribute secret.
7 8 9 |
# File 'lib/vertpig/configuration.rb', line 7 def secret @secret end |
Class Method Details
.defaults ⇒ Object
14 15 16 |
# File 'lib/vertpig/configuration.rb', line 14 def self.defaults @@defaults end |
Instance Method Details
#auth ⇒ Object
22 23 24 25 26 27 |
# File 'lib/vertpig/configuration.rb', line 22 def auth { key: key, secret: secret } end |
#reset ⇒ Object
29 30 31 |
# File 'lib/vertpig/configuration.rb', line 29 def reset @@defaults.each_pair { |k, v| send("#{k}=", v) } end |