Class: Infostrada::TeamInfo
- Inherits:
-
BaseRequest
- Object
- BaseRequest
- Infostrada::TeamInfo
- Defined in:
- lib/infostrada/team_info.rb
Constant Summary collapse
- URL =
'/GetTeamInfo'
Constants inherited from BaseRequest
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#country_short_name ⇒ Object
Returns the value of attribute country_short_name.
-
#foundation_date ⇒ Object
Returns the value of attribute foundation_date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#nickname ⇒ Object
Returns the value of attribute nickname.
-
#official_name ⇒ Object
Returns the value of attribute official_name.
-
#official_short_name ⇒ Object
Returns the value of attribute official_short_name.
-
#official_stadium_name ⇒ Object
Returns the value of attribute official_stadium_name.
-
#public_name ⇒ Object
Returns the value of attribute public_name.
-
#public_short_name ⇒ Object
Returns the value of attribute public_short_name.
-
#stadium_capacity ⇒ Object
Returns the value of attribute stadium_capacity.
-
#stadium_name ⇒ Object
Returns the value of attribute stadium_name.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash) ⇒ TeamInfo
constructor
A new instance of TeamInfo.
Methods inherited from BaseRequest
Constructor Details
#initialize(hash) ⇒ TeamInfo
Returns a new instance of TeamInfo.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/infostrada/team_info.rb', line 17 def initialize(hash) @id = hash['teamid'] @official_name = hash['c_OfficialName'] @official_short_name = hash['c_OfficialNameSort'] @public_name = hash['c_PublicName'] @public_short_name = hash['c_PublicNameSort'] @nickname = hash['c_Nickname'] @foundation_date = hash['d_FoundationDate'] @official_stadium_name = hash['c_StadiumOfficialName'] @stadium_name = hash['c_Stadium'] @stadium_capacity = hash['n_StadiumCapacity'] @url = hash['c_URL'] @city = hash['c_City'] @country = hash['c_Country'] @country_short_name = hash['c_CountryShort'] self end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
7 8 9 |
# File 'lib/infostrada/team_info.rb', line 7 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
7 8 9 |
# File 'lib/infostrada/team_info.rb', line 7 def country @country end |
#country_short_name ⇒ Object
Returns the value of attribute country_short_name.
7 8 9 |
# File 'lib/infostrada/team_info.rb', line 7 def country_short_name @country_short_name end |
#foundation_date ⇒ Object
Returns the value of attribute foundation_date.
6 7 8 |
# File 'lib/infostrada/team_info.rb', line 6 def foundation_date @foundation_date end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/infostrada/team_info.rb', line 7 def id @id end |
#nickname ⇒ Object
Returns the value of attribute nickname.
5 6 7 |
# File 'lib/infostrada/team_info.rb', line 5 def nickname @nickname end |
#official_name ⇒ Object
Returns the value of attribute official_name.
5 6 7 |
# File 'lib/infostrada/team_info.rb', line 5 def official_name @official_name end |
#official_short_name ⇒ Object
Returns the value of attribute official_short_name.
5 6 7 |
# File 'lib/infostrada/team_info.rb', line 5 def official_short_name @official_short_name end |
#official_stadium_name ⇒ Object
Returns the value of attribute official_stadium_name.
6 7 8 |
# File 'lib/infostrada/team_info.rb', line 6 def official_stadium_name @official_stadium_name end |
#public_name ⇒ Object
Returns the value of attribute public_name.
5 6 7 |
# File 'lib/infostrada/team_info.rb', line 5 def public_name @public_name end |
#public_short_name ⇒ Object
Returns the value of attribute public_short_name.
5 6 7 |
# File 'lib/infostrada/team_info.rb', line 5 def public_short_name @public_short_name end |
#stadium_capacity ⇒ Object
Returns the value of attribute stadium_capacity.
6 7 8 |
# File 'lib/infostrada/team_info.rb', line 6 def stadium_capacity @stadium_capacity end |
#stadium_name ⇒ Object
Returns the value of attribute stadium_name.
6 7 8 |
# File 'lib/infostrada/team_info.rb', line 6 def stadium_name @stadium_name end |
#url ⇒ Object
Returns the value of attribute url.
7 8 9 |
# File 'lib/infostrada/team_info.rb', line 7 def url @url end |
Class Method Details
.fetch(team_id) ⇒ Object
11 12 13 14 15 |
# File 'lib/infostrada/team_info.rb', line 11 def self.fetch(team_id) info_hash = get!(URL, query: { teamid: team_id.to_i }) info_hash.first ? new(info_hash.first.merge({ 'teamid' => team_id.to_i })) : nil end |