Module: Arcticelvis::Configuration
- Included in:
- Arcticelvis
- Defined in:
- lib/arcticelvis/configuration.rb
Constant Summary collapse
- VALID_CONFIG_KEYS =
[:api_key].freeze
- DEFAULT_API_KEY =
nil- API_HOST =
"http://api.arcticelvis.com"
Class Method Summary collapse
-
.extended(base) ⇒ Object
setup defaults on extend.
Instance Method Summary collapse
Class Method Details
.extended(base) ⇒ Object
setup defaults on extend
10 11 12 |
# File 'lib/arcticelvis/configuration.rb', line 10 def self.extended(base) base.reset end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
18 19 20 |
# File 'lib/arcticelvis/configuration.rb', line 18 def configure yield self end |
#options ⇒ Object
22 23 24 |
# File 'lib/arcticelvis/configuration.rb', line 22 def Hash[ * VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten ] end |
#reset ⇒ Object
14 15 16 |
# File 'lib/arcticelvis/configuration.rb', line 14 def reset self.api_key = DEFAULT_API_KEY end |