Sha256: 0d41408b2476771e90e4fc771b615667f030372bdacfd71eb0214548ded2c515

Contents?: true

Size: 832 Bytes

Versions: 22

Compression:

Stored size: 832 Bytes

Contents

module SportsDataApi
  module Ncaamb
    class Tournament
      attr_reader :id, :status, :year, :season, :status,
        :start_date, :end_date, :name, :location

      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

      def schedule
        Ncaamb.tournament_schedule(year, season, id)
      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.rb
sports_data_api-0.15.2 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.15.1 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.15.0 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.14.1 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.14.0 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.13.0 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.12.1 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.12.0 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.11.6 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.11.5 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.11.3 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.11.2 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.11.1 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.11.0 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.10.1 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.10.0 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.9.2 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.2.4 lib/sports_data_api/ncaamb/tournament.rb
sports_data_api-0.2.3 lib/sports_data_api/ncaamb/tournament.rb