Class: Barometer::WeatherService::Yahoo::Response::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/barometer/weather_services/yahoo/response/location.rb

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ Location

Returns a new instance of Location.



6
7
8
# File 'lib/barometer/weather_services/yahoo/response/location.rb', line 6

def initialize(payload)
  @payload = payload
end

Instance Method Details

#parseObject



10
11
12
13
14
15
16
17
18
# File 'lib/barometer/weather_services/yahoo/response/location.rb', line 10

def parse
  Data::Location.new(
    city: city,
    state_code: state_code,
    country_code: country_code,
    latitude: latitude,
    longitude: longitude
  )
end