Module: Lieu::Configuration
- Included in:
- Lieu
- Defined in:
- lib/lieu/configuration.rb
Overview
Methods for Lieu configuration
Constant Summary collapse
- VALID_OPTIONS =
Configurable options
[ :api_endpoint, :api_key, :sensor ].freeze
- DEFAULT_API_ENDPOINT =
Default Google Place API endpoint
'https://maps.googleapis.com/maps/api/place/'
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
22 23 24 |
# File 'lib/lieu/configuration.rb', line 22 def configure yield self end |
#initialize_default_options ⇒ Object
Initialize default options
32 33 34 35 36 |
# File 'lib/lieu/configuration.rb', line 32 def self.api_endpoint = DEFAULT_API_ENDPOINT self.api_key = nil self.sensor = false end |
#options ⇒ Object
Default options
27 28 29 |
# File 'lib/lieu/configuration.rb', line 27 def VALID_OPTIONS.inject({}){ |o, k| o.merge!(k => send(k)) } end |
#reset! ⇒ Object
Reset configuration options to default values
39 40 41 42 43 |
# File 'lib/lieu/configuration.rb', line 39 def reset! self end |