Module: Hamweather

Defined in:
lib/hamweather.rb,
lib/hamweather/forecast.rb,
lib/hamweather/location.rb,
lib/hamweather/forecast/daily.rb,
lib/hamweather/forecast/hourly.rb

Defined Under Namespace

Classes: ApiKeyException, Forecast, GoogleApiKeyException, Location, UnknownAddressError

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Returns the value of attribute api_key.



19
20
21
# File 'lib/hamweather.rb', line 19

def api_key
  @api_key
end

.google_maps_api_keyObject

Returns the value of attribute google_maps_api_key.



19
20
21
# File 'lib/hamweather.rb', line 19

def google_maps_api_key
  @google_maps_api_key
end

Class Method Details

.forecast(location) ⇒ Object



30
31
32
33
# File 'lib/hamweather.rb', line 30

def forecast(location)
  check_api_key
  Hamweather::Forecast.new(location)
end

.locate(place) ⇒ Object

Hamweather.api_key = “…” Hamweather.google_maps_api_key = “…” locations = Hamweather.locate “Belfast” Hamweather.forecast(locations.first)



25
26
27
28
# File 'lib/hamweather.rb', line 25

def locate(place)
  check_api_key
  @location = Hamweather::Location.parse(place)
end