Module: Azimuth::Configuration
- Included in:
- Azimuth
- Defined in:
- lib/azimuth/configuration.rb
Overview
Methods for Azimuth configuration
Constant Summary collapse
- VALID_OPTIONS =
Configurable options
[ :api_endpoint, :api_key, ].freeze
- DEFAULT_API_ENDPOINT =
Default MapQuest Directions API endpoint
'http://www.mapquestapi.com/directions/v2/'
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Set configuration options using a block.
-
#initialize_default_options ⇒ Object
Initialize default options.
-
#options ⇒ Object
Default options.
-
#reset! ⇒ Object
Reset configuration options to default values.
Instance Method Details
#configure {|_self| ... } ⇒ Object
Set configuration options using a block
21 22 23 |
# File 'lib/azimuth/configuration.rb', line 21 def configure yield self end |
#initialize_default_options ⇒ Object
Initialize default options
31 32 33 34 |
# File 'lib/azimuth/configuration.rb', line 31 def self.api_endpoint = DEFAULT_API_ENDPOINT self.api_key = nil end |
#options ⇒ Object
Default options
26 27 28 |
# File 'lib/azimuth/configuration.rb', line 26 def VALID_OPTIONS.inject({}){ |o, k| o.merge!(k => send(k)) } end |
#reset! ⇒ Object
Reset configuration options to default values
37 38 39 40 41 |
# File 'lib/azimuth/configuration.rb', line 37 def reset! self end |