Module: ForecastIO::Configuration
- Included in:
- ForecastIO
- Defined in:
- lib/forecast_io/configuration.rb
Constant Summary collapse
- DEFAULT_FORECAST_IO_API_ENDPOINT =
Default API endpoint
'https://api.forecast.io'
Instance Attribute Summary collapse
-
#api_endpoint ⇒ Object
API endpoint.
-
#api_key ⇒ Object
API key.
-
#default_params ⇒ Object
Default parameters.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Yield self to be able to configure ForecastIO with block-style configuration.
Instance Attribute Details
#api_endpoint ⇒ Object
API endpoint
27 28 29 |
# File 'lib/forecast_io/configuration.rb', line 27 def api_endpoint @api_endpoint ||= DEFAULT_FORECAST_IO_API_ENDPOINT end |
#api_key ⇒ Object
API key
32 33 34 |
# File 'lib/forecast_io/configuration.rb', line 32 def api_key @api_key end |
#default_params ⇒ Object
Default parameters
13 14 15 |
# File 'lib/forecast_io/configuration.rb', line 13 def default_params @default_params end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Yield self to be able to configure ForecastIO with block-style configuration.
Example:
ForecastIO.configure do |configuration|
configuration.api_key = 'this-is-your-api-key'
end
22 23 24 |
# File 'lib/forecast_io/configuration.rb', line 22 def configure yield self end |