Class: AFL::Season

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

Instance Method Summary collapse

Constructor Details

#initialize(year, team_name = nil) ⇒ Season

Returns a new instance of Season.



4
5
6
7
# File 'lib/afl/season.rb', line 4

def initialize(year, team_name = nil)
  @year, @team_name = year, team_name
  @team_name ? @matches = team_matches : @matches = season_matches
end

Instance Method Details

#next_match(time = Time.now) ⇒ Object



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

def next_match(time = Time.now)
  @matches.each do |match|
    if match.time > time
      break match
    end
  end
end