Class: Sportradar::Api::Basketball::Ncaamb::Team

Inherits:
Team
  • Object
show all
Defined in:
lib/sportradar/api/basketball/ncaamb/team.rb

Instance Attribute Summary collapse

Attributes inherited from Team

#alias, #full_name, #id, #market, #name, #player_stats, #records, #response, #seed, #team_stats, #venue

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Team

#add_game, #games, #get_roster, #get_season_stats, #handle_names, #ingest_roster, #ingest_season_stats, #initialize, #parse_players, #parse_records, #parse_season_stats, #path_base, #path_base_stats, #path_roster, #path_season_stats, #players, #profile, #queue_roster, #queue_season_stats, #record, #update, #update_player_stats

Methods inherited from Data

#all_attributes, #attributes, #create_data, #parse_into_array, #parse_into_array_with_options, #parse_out_hashes, #structure_links, #update_data

Constructor Details

This class inherits a constructor from Sportradar::Api::Basketball::Team

Instance Attribute Details

#sourceObject

Returns the value of attribute source.



6
7
8
# File 'lib/sportradar/api/basketball/ncaamb/team.rb', line 6

def source
  @source
end

#source_idObject

Returns the value of attribute source_id.



6
7
8
# File 'lib/sportradar/api/basketball/ncaamb/team.rb', line 6

def source_id
  @source_id
end

Class Method Details

.allObject



25
26
27
# File 'lib/sportradar/api/basketball/ncaamb/team.rb', line 25

def self.all
  @all_hash.values
end

.new(data, **opts) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/sportradar/api/basketball/ncaamb/team.rb', line 9

def self.new(data, **opts)
  existing = @all_hash[data['id']]
  if existing
    existing.update(data, **opts)
    existing
  else
    if data['id']
      @all_hash[data['id']] = super
    else # tournament placeholder
      super.tap do |team|
        team.source = data['source']
        team.source_id = data.dig('source', 'id')
      end
    end
  end
end

Instance Method Details

#apiObject



33
34
35
# File 'lib/sportradar/api/basketball/ncaamb/team.rb', line 33

def api
  @api || Sportradar::Api::Basketball::Ncaamb::Api.new
end

#good_guys?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/sportradar/api/basketball/ncaamb/team.rb', line 37

def good_guys?
  id == "9b166a3f-e64b-4825-bb6b-92c6f0418263"
end

#player_classObject



29
30
31
# File 'lib/sportradar/api/basketball/ncaamb/team.rb', line 29

def player_class
  Player
end