Sha256: 9e69af51619d9eda4bf00024a2f99adfe406afca043121dafcccfb7bfcaafde3

Contents?: true

Size: 621 Bytes

Versions: 22

Compression:

Stored size: 621 Bytes

Contents

module SportsDataApi
  module Ncaamb
    class TournamentGame < SimpleDelegator
      attr_reader :id, :round_number, :round_name, :bracket

      def initialize(args={})
        xml = args.fetch(:xml)
        @bracket = args[:bracket]
        round = args[:round] || {}
        @round_name = round[:name]
        @round_number = round[:number] ? round[:number].to_i : nil

        xml = xml.first if xml.is_a? Nokogiri::XML::NodeSet
        if xml.is_a? Nokogiri::XML::Element
          @id = xml['id']
        end

        super(Game.new(year: args[:year], season: args[:season], xml: xml))
      end

    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

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