class Barometer::Noaa::Response::CurrentStation

Attributes

station[R]

Public Class Methods

new(payload, response) click to toggle source
Calls superclass method
# File lib/barometer/noaa/response/current_station.rb, line 5
def initialize(payload, response)
  super(payload)
  @station = response.station
end

Private Instance Methods

city() click to toggle source
# File lib/barometer/noaa/response/current_station.rb, line 22
def city
  payload.using(/^(.*?),/).fetch('location')
end
country_code() click to toggle source
# File lib/barometer/noaa/response/current_station.rb, line 30
def country_code
  'US'
end
id() click to toggle source
# File lib/barometer/noaa/response/current_station.rb, line 14
def id
  payload.fetch('station_id')
end
latitude() click to toggle source
# File lib/barometer/noaa/response/current_station.rb, line 34
def latitude
  station.latitude
end
longitude() click to toggle source
# File lib/barometer/noaa/response/current_station.rb, line 38
def longitude
  station.longitude
end
name() click to toggle source
# File lib/barometer/noaa/response/current_station.rb, line 18
def name
  payload.fetch('location')
end
state_code() click to toggle source
# File lib/barometer/noaa/response/current_station.rb, line 26
def state_code
  payload.using(/,(.*?)$/).fetch('location')
end