Class: OpenMeteo::Client::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/open_meteo/client/config.rb

Overview

The configuration for the OpenMeteo::Client.

Instance Attribute Summary collapse

Instance Method Summary collapse

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_keyObject (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

#hostObject (readonly)

Returns the value of attribute host.



6
7
8
# File 'lib/open_meteo/client/config.rb', line 6

def host
  @host
end

#loggerObject (readonly)

Returns the value of attribute logger.



6
7
8
# File 'lib/open_meteo/client/config.rb', line 6

def logger
  @logger
end

#timeoutsObject (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

#urlObject



15
16
17
# File 'lib/open_meteo/client/config.rb', line 15

def url
  "https://#{host}"
end