Class: SportsDataApi::Ncaamb::TournamentGame
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- SportsDataApi::Ncaamb::TournamentGame
- Defined in:
- lib/sports_data_api/ncaamb/tournament_game.rb
Instance Attribute Summary collapse
-
#bracket ⇒ Object
readonly
Returns the value of attribute bracket.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#round_name ⇒ Object
readonly
Returns the value of attribute round_name.
-
#round_number ⇒ Object
readonly
Returns the value of attribute round_number.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ TournamentGame
constructor
A new instance of TournamentGame.
Constructor Details
#initialize(args = {}) ⇒ TournamentGame
Returns a new instance of TournamentGame.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/sports_data_api/ncaamb/tournament_game.rb', line 6 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 |
Instance Attribute Details
#bracket ⇒ Object (readonly)
Returns the value of attribute bracket.
4 5 6 |
# File 'lib/sports_data_api/ncaamb/tournament_game.rb', line 4 def bracket @bracket end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/sports_data_api/ncaamb/tournament_game.rb', line 4 def id @id end |
#round_name ⇒ Object (readonly)
Returns the value of attribute round_name.
4 5 6 |
# File 'lib/sports_data_api/ncaamb/tournament_game.rb', line 4 def round_name @round_name end |
#round_number ⇒ Object (readonly)
Returns the value of attribute round_number.
4 5 6 |
# File 'lib/sports_data_api/ncaamb/tournament_game.rb', line 4 def round_number @round_number end |