Sha256: b9bc938e997f39b647906e9d6c1703e90987212330e5a68ce33c36c4b63963b3

Contents?: true

Size: 578 Bytes

Versions: 21

Compression:

Stored size: 578 Bytes

Contents

module SportsDataApi
  module Ncaafb
    class Games
      include Enumerable
      attr_reader :games, :year, :season, :week

      def initialize(year, season, week, games_hash)
        @year = year
        @season = season
        @week = week

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

      def each &block
        @games.each do |game|
          if block_given?
            block.call game
          else
            yield game
          end
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
sports_data_api-0.15.3 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.15.2 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.15.1 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.15.0 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.14.1 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.14.0 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.13.0 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.12.1 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.12.0 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.11.6 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.11.5 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.11.3 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.11.2 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.11.1 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.11.0 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.10.1 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.10.0 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.9.2 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.2.4 lib/sports_data_api/ncaafb/games.rb
sports_data_api-0.2.3 lib/sports_data_api/ncaafb/games.rb