Class: EventDb::EventCursor

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

Defined Under Namespace

Classes: State

Instance Method Summary collapse

Constructor Details

#initialize(events) ⇒ EventCursor

Returns a new instance of EventCursor.



5
6
7
# File 'lib/eventdb/calendar.rb', line 5

def initialize( events )
  @events = events
end

Instance Method Details

#eachObject



9
10
11
12
13
14
15
# File 'lib/eventdb/calendar.rb', line 9

def each
  state = State.new
  @events.each do |event|
     state.next( event )
     yield( event, state )
  end
end