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.darksky.net'
Instance Attribute Summary collapse
-
#api_endpoint ⇒ Object
API endpoint.
-
#api_key ⇒ Object
API key.
-
#default_params ⇒ Object
Default parameters.
-
#timeout ⇒ Object
Request read timeout.
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
31 32 33 |
# File 'lib/forecast_io/configuration.rb', line 31 def api_endpoint @api_endpoint ||= DEFAULT_FORECAST_IO_API_ENDPOINT end |
#api_key ⇒ Object
API key
36 37 38 |
# File 'lib/forecast_io/configuration.rb', line 36 def api_key @api_key end |
#default_params ⇒ Object
Default parameters
16 17 18 |
# File 'lib/forecast_io/configuration.rb', line 16 def default_params @default_params end |
#timeout ⇒ Object
Request read timeout
41 42 43 |
# File 'lib/forecast_io/configuration.rb', line 41 def timeout @timeout 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'
configuration.timeout = 500
end
26 27 28 |
# File 'lib/forecast_io/configuration.rb', line 26 def configure yield self end |