Class: Readmill::Configuration
- Inherits:
-
Object
- Object
- Readmill::Configuration
- Defined in:
- lib/readmill/configuration.rb
Overview
Internal: Store all of the configurable options inside of a Configuration class.
Constant Summary collapse
- VALID_CONFIGURATION_KEYS =
Public: An Array of all keys that can be configured. This allows us to set instance keys, knowing what can and cannot be modified.
[:client_id, :timeout, :open_timeout, :adapter]
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Internal: Default all of the keys to valid defaults.
-
#values ⇒ Object
Public: Return all of the current values.
Constructor Details
#initialize ⇒ Configuration
Internal: Default all of the keys to valid defaults.
31 32 33 34 35 36 |
# File 'lib/readmill/configuration.rb', line 31 def initialize self.client_id = nil self.timeout = 10 self.open_timeout = 10 self.adapter = Faraday.default_adapter end |
Instance Method Details
#values ⇒ Object
Public: Return all of the current values.
Returns a Hash.
41 42 43 |
# File 'lib/readmill/configuration.rb', line 41 def values VALID_CONFIGURATION_KEYS.inject({}){|o,k| o.merge!(k => send(k)) } end |