Class: SportsDataApi::Ncaafb::Week

Inherits:
Object
  • Object
show all
Defined in:
lib/sports_data_api/ncaafb/week.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(year, season, week_hash) ⇒ Week

Returns a new instance of Week.



6
7
8
9
10
11
12
13
14
15
# File 'lib/sports_data_api/ncaafb/week.rb', line 6

def initialize(year, season, week_hash)
  @games = []
  @year = year
  @season = season

  @number = week_hash['number']
  @games = week_hash['games'].map do |game_hash|
    Game.new(@year, @season, @number, game_hash)
  end
end

Instance Attribute Details

#gamesObject (readonly)

Returns the value of attribute games.



4
5
6
# File 'lib/sports_data_api/ncaafb/week.rb', line 4

def games
  @games
end

#numberObject (readonly)

Returns the value of attribute number.



4
5
6
# File 'lib/sports_data_api/ncaafb/week.rb', line 4

def number
  @number
end

#seasonObject (readonly)

Returns the value of attribute season.



4
5
6
# File 'lib/sports_data_api/ncaafb/week.rb', line 4

def season
  @season
end

#yearObject (readonly)

Returns the value of attribute year.



4
5
6
# File 'lib/sports_data_api/ncaafb/week.rb', line 4

def year
  @year
end