Class: Parser::Sheet

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

Constant Summary collapse

EVENT_CODE =
'1914'

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ Sheet

Returns a new instance of Sheet.



7
8
9
# File 'lib/parser/sheet.rb', line 7

def initialize(file)
  @file = file
end

Instance Method Details

#each_eventObject



19
20
21
22
23
# File 'lib/parser/sheet.rb', line 19

def each_event
  events.each do |event|
    yield(event)
  end
end

#eventsObject



11
12
13
14
15
16
17
# File 'lib/parser/sheet.rb', line 11

def events
  @events ||= [].tap do |events|
    worksheet.each do |row|
      events << Event.new(row[4], row[5], row[10]) if row_is_event?(row)
    end
  end
end