Class: WeatherBug::LiveObservation

Inherits:
TransformableData show all
Defined in:
lib/weatherbug/live_observation.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TransformableData

register_transformer

Class Method Details

.from_document(document) ⇒ Object

Raises:



21
22
23
24
25
# File 'lib/weatherbug/live_observation.rb', line 21

def self.from_document(document)
  lops = super
  raise NoSuchStation, 'No such station' if lops.station_id.empty?
  lops
end

Instance Method Details

#stationObject



27
28
29
# File 'lib/weatherbug/live_observation.rb', line 27

def station
  @station_reference ||= WeatherBug.get_station(self.station_id)
end