Class: OpenMeteo::Client::Config
- Inherits:
-
Object
- Object
- OpenMeteo::Client::Config
- Defined in:
- lib/open_meteo/client/config.rb
Overview
The configuration for the OpenMeteo::Client.
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#timeouts ⇒ Object
readonly
Returns the value of attribute timeouts.
Instance Method Summary collapse
-
#initialize(api_key: nil, host: nil, logger: nil, timeouts: nil) ⇒ Config
constructor
A new instance of Config.
- #url ⇒ Object
Constructor Details
#initialize(api_key: nil, host: nil, logger: nil, timeouts: nil) ⇒ Config
Returns a new instance of Config.
8 9 10 11 12 13 |
# File 'lib/open_meteo/client/config.rb', line 8 def initialize(api_key: nil, host: nil, logger: nil, timeouts: nil) @api_key = api_key || OpenMeteo.configuration.api_key @host = host || OpenMeteo.configuration.host @logger = logger || OpenMeteo.configuration.logger @timeouts = timeouts || OpenMeteo.configuration.timeouts end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/open_meteo/client/config.rb', line 6 def api_key @api_key end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
6 7 8 |
# File 'lib/open_meteo/client/config.rb', line 6 def host @host end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
6 7 8 |
# File 'lib/open_meteo/client/config.rb', line 6 def logger @logger end |
#timeouts ⇒ Object (readonly)
Returns the value of attribute timeouts.
6 7 8 |
# File 'lib/open_meteo/client/config.rb', line 6 def timeouts @timeouts end |
Instance Method Details
#url ⇒ Object
15 16 17 |
# File 'lib/open_meteo/client/config.rb', line 15 def url "https://#{host}" end |