Class: MLBStatsAPI::Team

Inherits:
Base
  • Object
show all
Defined in:
lib/mlb_stats_api/team.rb

Instance Attribute Summary

Attributes inherited from Base

#data

Instance Method Summary collapse

Methods inherited from Base

#[], #dig, #initialize

Constructor Details

This class inherits a constructor from MLBStatsAPI::Base

Instance Method Details

#abbreviationObject Also known as: code



17
18
19
# File 'lib/mlb_stats_api/team.rb', line 17

def abbreviation
  @data['abbreviation']
end

#division_idObject



34
35
36
# File 'lib/mlb_stats_api/team.rb', line 34

def division_id
  @data.dig('division', 'id')
end

#file_codeObject



22
23
24
# File 'lib/mlb_stats_api/team.rb', line 22

def file_code
  @data['fileCode']
end

#full_nameObject



38
39
40
# File 'lib/mlb_stats_api/team.rb', line 38

def full_name
  @data['name']
end

#idObject



5
6
7
# File 'lib/mlb_stats_api/team.rb', line 5

def id
  @data['id']
end

#inspectObject

So we don’t get huge printouts



43
44
45
# File 'lib/mlb_stats_api/team.rb', line 43

def inspect
  %(#<MLBGameday::Team @name="#{name}">)
end

#league_idObject



30
31
32
# File 'lib/mlb_stats_api/team.rb', line 30

def league_id
  @data.dig('league', 'id')
end

#locationObject



13
14
15
# File 'lib/mlb_stats_api/team.rb', line 13

def location
  @data['locationName']
end

#nameObject



9
10
11
# File 'lib/mlb_stats_api/team.rb', line 9

def name
  @data['teamName']
end

#short_nameObject



26
27
28
# File 'lib/mlb_stats_api/team.rb', line 26

def short_name
  @data['shortName']
end