class SportsDataApi::Ncaamb::Tournament

Attributes

end_date[R]
id[R]
location[R]
name[R]
season[R]
start_date[R]
status[R]
year[R]

Public Class Methods

new(args={}) click to toggle source
# File lib/sports_data_api/ncaamb/tournament.rb, line 7
def initialize(args={})
  xml = args.fetch(:xml)
  @year = args[:year] ? args[:year].to_i : nil
  @season = args[:season] ? args[:season].to_sym : nil

  xml = xml.first if xml.is_a? Nokogiri::XML::NodeSet
  if xml.is_a? Nokogiri::XML::Element
    @id = xml['id']
    @start_date = Time.parse xml['start_date']
    @end_date = Time.parse xml['end_date']
    @status = xml['status']
    @name = xml['name']
    @location = xml['location']
    @status = xml['status']
  end
end

Public Instance Methods

schedule() click to toggle source
# File lib/sports_data_api/ncaamb/tournament.rb, line 24
def schedule
  Ncaamb.tournament_schedule(year, season, id)
end