Module: ForecastIO::Configuration
- Included in:
- ForecastIO
- Defined in:
- lib/pirate_weather_forecast_ruby/configuration.rb
Constant Summary collapse
- DEFAULT_FORECAST_IO_API_ENDPOINT =
Default API endpoint
"https://api.pirateweather.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
33 34 35 |
# File 'lib/pirate_weather_forecast_ruby/configuration.rb', line 33 def api_endpoint @api_endpoint ||= DEFAULT_FORECAST_IO_API_ENDPOINT end |
#api_key ⇒ Object
API key
38 39 40 |
# File 'lib/pirate_weather_forecast_ruby/configuration.rb', line 38 def api_key @api_key end |
#default_params ⇒ Object
Default parameters
18 19 20 |
# File 'lib/pirate_weather_forecast_ruby/configuration.rb', line 18 def default_params @default_params end |
#timeout ⇒ Object
Request read timeout
43 44 45 |
# File 'lib/pirate_weather_forecast_ruby/configuration.rb', line 43 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
28 29 30 |
# File 'lib/pirate_weather_forecast_ruby/configuration.rb', line 28 def configure yield self end |