Class: SportDb::Model::MatchCursor
- Inherits:
-
Object
- Object
- SportDb::Model::MatchCursor
- Defined in:
- lib/sportdb/models/utils.rb
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(matches) ⇒ MatchCursor
constructor
A new instance of MatchCursor.
Constructor Details
#initialize(matches) ⇒ MatchCursor
Returns a new instance of MatchCursor.
7 8 9 |
# File 'lib/sportdb/models/utils.rb', line 7 def initialize( matches ) @matches = matches end |
Instance Method Details
#each ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/sportdb/models/utils.rb', line 11 def each state = MatchCursorState.new @matches.each do |match| state.next( match ) yield( match, state ) # e.g. lets you use state.new_date? or state.new_week? or state.new_year? etc. end end |