Class: Cambio::Configuration
- Inherits:
-
Object
- Object
- Cambio::Configuration
- Defined in:
- lib/cambio/configuration.rb
Overview
Internal: An object to hold the internal configuration of the Cambio module
Constant Summary collapse
- DEFAULT_APP_ID =
Internal: By default, don’t set an app ID
nil
- DEFAULT_ENDPOINT =
Internal: The default API endpoint, it can also be set to use https
'http://openexchangerates.org/api/'
Instance Attribute Summary collapse
-
#app_id ⇒ Object
Public: Gets/Sets the String app_id.
-
#endpoint ⇒ Object
Public: Gets/Sets the String endpoint.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Internal: The configuration object should be initialized by the Cambio module.
-
#reset ⇒ Object
Public: resets the internal configuration to the defaults.
Constructor Details
#initialize ⇒ Configuration
Internal: The configuration object should be initialized by the Cambio module
17 18 19 |
# File 'lib/cambio/configuration.rb', line 17 def initialize @endpoint = DEFAULT_ENDPOINT end |
Instance Attribute Details
#app_id ⇒ Object
Public: Gets/Sets the String app_id
5 6 7 |
# File 'lib/cambio/configuration.rb', line 5 def app_id @app_id end |
#endpoint ⇒ Object
Public: Gets/Sets the String endpoint
7 8 9 |
# File 'lib/cambio/configuration.rb', line 7 def endpoint @endpoint end |
Instance Method Details
#reset ⇒ Object
Public: resets the internal configuration to the defaults
Examples
configuration.reset
26 27 28 29 |
# File 'lib/cambio/configuration.rb', line 26 def reset @endpoint = DEFAULT_ENDPOINT @app_id = DEFAULT_APP_ID end |