Module: OpenWeather::ClassMethods

Included in:
Base
Defined in:
lib/open_weather/api.rb

Instance Method Summary collapse

Instance Method Details

#city(city, options = {}) ⇒ Object

City format : Eg, Cochin,IN Useage: OpenWeather::Current.city(‘Cochin,In’)



6
7
8
# File 'lib/open_weather/api.rb', line 6

def city(city, options = {})
  new(options.merge(city: city)).retrive
end

#city_id(id, options = {}) ⇒ Object

City Id, an integer value. Eg, 2172797 Useage: OpenWeather::Current.city_id(2172797)



12
13
14
# File 'lib/open_weather/api.rb', line 12

def city_id(id, options = {})
  new(options.merge(id: id)).retrive
end

#geocode(lat, lon, options = {}) ⇒ Object

City Geographics Cordingates : Eg, lat 35 lon 139



17
18
19
# File 'lib/open_weather/api.rb', line 17

def geocode(lat, lon, options = {})
  new(options.merge(lat: lat, lon: lon)).retrive
end