class SportsDataApi::Ncaamb::TournamentList

Attributes

id[R]
season[R]
tournaments[R]
year[R]

Public Class Methods

new(xml) click to toggle source
# File lib/sports_data_api/ncaamb/tournament_list.rb, line 6
def initialize(xml)
  if xml.is_a? Nokogiri::XML::NodeSet
    @id = xml.first["id"]
    @year = xml.first["year"].to_i
    @season = xml.first["type"].to_sym

    @tournaments = xml.first.xpath("tournament").map do |tournament_xml|
      Tournament.new(year: @year, season: @season, xml: tournament_xml)
    end
  end
end
valid?(season) click to toggle source

Check if the requested season is a valid NCAAMB season type.

The only valid types are: :reg, :pst, :ct

# File lib/sports_data_api/ncaamb/tournament_list.rb, line 23
def self.valid?(season)
  [:REG, :PST, :CT].include?(season)
end