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

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

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ Location

Returns a new instance of Location.



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

def initialize(payload)
  @payload = payload
end

Instance Method Details

#parseObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/barometer/weather_services/response/location.rb', line 9

def parse
  Data::Location.new(
    id: id,
    name: name,
    city: city,
    state_name: state_name,
    state_code: state_code,
    country: country,
    country_code: country_code,
    zip_code: zip_code,
    latitude: latitude,
    longitude: longitude
  )
end