Class: MLBStatsAPI::Team
- Inherits:
-
Base
- Object
- Base
- MLBStatsAPI::Team
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
Instance Method Details
#abbreviation ⇒ Object
Also known as:
code
17
18
19
|
# File 'lib/mlb_stats_api/team.rb', line 17
def abbreviation
@data['abbreviation']
end
|
#division_id ⇒ Object
34
35
36
|
# File 'lib/mlb_stats_api/team.rb', line 34
def division_id
@data.dig('division', 'id')
end
|
#file_code ⇒ Object
22
23
24
|
# File 'lib/mlb_stats_api/team.rb', line 22
def file_code
@data['fileCode']
end
|
#full_name ⇒ Object
38
39
40
|
# File 'lib/mlb_stats_api/team.rb', line 38
def full_name
@data['name']
end
|
#id ⇒ Object
5
6
7
|
# File 'lib/mlb_stats_api/team.rb', line 5
def id
@data['id']
end
|
#inspect ⇒ Object
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_id ⇒ Object
30
31
32
|
# File 'lib/mlb_stats_api/team.rb', line 30
def league_id
@data.dig('league', 'id')
end
|
#location ⇒ Object
13
14
15
|
# File 'lib/mlb_stats_api/team.rb', line 13
def location
@data['locationName']
end
|
#name ⇒ Object
9
10
11
|
# File 'lib/mlb_stats_api/team.rb', line 9
def name
@data['teamName']
end
|
#short_name ⇒ Object
26
27
28
|
# File 'lib/mlb_stats_api/team.rb', line 26
def short_name
@data['shortName']
end
|