Class: NOAA::StationWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/noaa/station_writer.rb

Instance Method Summary collapse

Constructor Details

#initialize(doc) ⇒ StationWriter

Returns a new instance of StationWriter.



3
4
5
# File 'lib/noaa/station_writer.rb', line 3

def initialize(doc)
  @doc = doc
end

Instance Method Details

#write(io) ⇒ Object



7
8
9
# File 'lib/noaa/station_writer.rb', line 7

def write(io)
  YAML.dump(@doc.find('/wx_station_index/station').map { |node| node_to_hash(node) }, io)
end