Class: FootballApi::MatchInfo
- Inherits:
-
Object
- Object
- FootballApi::MatchInfo
- Defined in:
- lib/football_api/match_info.rb
Instance Attribute Summary collapse
-
#attendance ⇒ Object
Returns the value of attribute attendance.
-
#id ⇒ Object
Returns the value of attribute id.
-
#referee ⇒ Object
Returns the value of attribute referee.
-
#stadium_name ⇒ Object
Returns the value of attribute stadium_name.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ MatchInfo
constructor
A new instance of MatchInfo.
Constructor Details
#initialize(hash = {}) ⇒ MatchInfo
Returns a new instance of MatchInfo.
6 7 8 9 10 11 12 |
# File 'lib/football_api/match_info.rb', line 6 def initialize(hash = {}) @id = hash[:id] @stadium_name = hash[:stadium][:name] if hash[:stadium] @attendance = hash[:attendance][:name] if hash[:attendance] @time = hash[:time][:name] if hash[:time] @referee = hash[:referee][:name] if hash[:referee] end |
Instance Attribute Details
#attendance ⇒ Object
Returns the value of attribute attendance.
4 5 6 |
# File 'lib/football_api/match_info.rb', line 4 def attendance @attendance end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/football_api/match_info.rb', line 4 def id @id end |
#referee ⇒ Object
Returns the value of attribute referee.
4 5 6 |
# File 'lib/football_api/match_info.rb', line 4 def referee @referee end |
#stadium_name ⇒ Object
Returns the value of attribute stadium_name.
4 5 6 |
# File 'lib/football_api/match_info.rb', line 4 def stadium_name @stadium_name end |
#time ⇒ Object
Returns the value of attribute time.
4 5 6 |
# File 'lib/football_api/match_info.rb', line 4 def time @time end |