class NoaaWeatherClient::Responses::Station
Public Class Methods
new(station)
click to toggle source
# File lib/noaa_weather_client/responses/station.rb, line 8 def initialize(station) @source = station end
Public Instance Methods
latitude()
click to toggle source
# File lib/noaa_weather_client/responses/station.rb, line 12 def latitude source.css('latitude').text.to_f end
longitude()
click to toggle source
# File lib/noaa_weather_client/responses/station.rb, line 16 def longitude source.css('longitude').text.to_f end
xml_url()
click to toggle source
# File lib/noaa_weather_client/responses/station.rb, line 20 def xml_url @xml_url ||= begin path = URI(source.css('xml_url').text).path "http://w1.weather.gov#{path}" end end