Class: OpenWeather::Client

Inherits:
Object
  • Object
show all
Includes:
Connection, Endpoints::Current, Endpoints::OneCall, Endpoints::Stations, Request
Defined in:
lib/open_weather/client.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Endpoints::Stations

#create_measurements, #delete_station, #get_measurements, #get_station, #list_stations, #register_station, #update_station

Methods included from Endpoints::OneCall

#one_call

Methods included from Endpoints::Current

#current_cities_geo_box, #current_cities_geo_circle, #current_cities_id, #current_city, #current_city_id, #current_geo, #current_weather, #current_zip

Methods included from Request

#delete, #get, #post, #put

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



13
14
15
16
17
18
# File 'lib/open_weather/client.rb', line 13

def initialize(options = {})
  OpenWeather::Config::ATTRIBUTES.each do |key|
    send("#{key}=", options[key] || OpenWeather.config.send(key))
  end
  @logger ||= OpenWeather::Logger.logger
end

Class Method Details

.configObject



25
26
27
# File 'lib/open_weather/client.rb', line 25

def config
  Config
end

.configureObject



21
22
23
# File 'lib/open_weather/client.rb', line 21

def configure
  block_given? ? yield(Config) : Config
end