Class: Puertos::RowParser
- Inherits:
-
Object
- Object
- Puertos::RowParser
- Defined in:
- lib/row_parser.rb
Overview
The Parser is responsible of fetching the data from Puertos del Estado and return it as ruby objects
Instance Attribute Summary collapse
-
#row ⇒ Object
readonly
Returns the value of attribute row.
Instance Method Summary collapse
-
#initialize(row) ⇒ RowParser
constructor
A new instance of RowParser.
-
#run ⇒ ForecastData
parses each input line and returns a ForecastData object.
Constructor Details
#initialize(row) ⇒ RowParser
Returns a new instance of RowParser.
10 11 12 |
# File 'lib/row_parser.rb', line 10 def initialize row @row = row end |
Instance Attribute Details
#row ⇒ Object (readonly)
Returns the value of attribute row.
8 9 10 |
# File 'lib/row_parser.rb', line 8 def row @row end |
Instance Method Details
#run ⇒ ForecastData
parses each input line and returns a ForecastData object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/row_parser.rb', line 17 def run = wind = create_wind_data total_swell = create_total_swell_data wind_swell = create_wind_swell_data ground_swell_1 = create_ground_swell_data_1 ground_swell_2 = create_ground_swell_data_2 ForecastData.new , wind, total_swell, wind_swell, ground_swell_1, ground_swell_2 end |