Class: Puertos::Parser

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

Instance Method Summary collapse

Instance Method Details

#runArray

uses the row parser to parse line by line the forecast table

Returns:

  • (Array)

    Array of ForecastData with all the relevant information



15
16
17
18
19
20
21
# File 'lib/parser.rb', line 15

def run
  rows = Nokogiri::HTML(open(DATA_URL)).css CSS_ROWS_SELECTOR

  rows.drop(2).map do |row|
    Puertos::RowParser.new(row).run
  end
end