Class: TF1Converter::CsvFile
- Inherits:
-
Object
- Object
- TF1Converter::CsvFile
- Defined in:
- lib/tf1_converter/csv_file.rb
Instance Method Summary collapse
-
#initialize(waypoints, path) ⇒ CsvFile
constructor
A new instance of CsvFile.
- #to_csv! ⇒ Object
Constructor Details
#initialize(waypoints, path) ⇒ CsvFile
Returns a new instance of CsvFile.
5 6 7 8 |
# File 'lib/tf1_converter/csv_file.rb', line 5 def initialize(waypoints, path) @waypoints = waypoints @path = path end |
Instance Method Details
#to_csv! ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/tf1_converter/csv_file.rb', line 10 def to_csv! CSV.open(@path, 'wb') do |csv| csv << ['filename', 'name', 'meaning', 'time', 'lat', 'long', 'usng', 'elevation'] @waypoints.each do |wp| csv << [@path.split('.').first, wp.name, wp.icon_meaning, wp., wp.lat, wp.long, wp.usng, wp.elevation] end end end |