Class: NOAA::StationWriter
- Inherits:
-
Object
- Object
- NOAA::StationWriter
- Defined in:
- lib/noaa/station_writer.rb
Instance Method Summary collapse
-
#initialize(doc) ⇒ StationWriter
constructor
A new instance of StationWriter.
- #write(io) ⇒ Object
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 |