Class: FootballApi::Stats
- Inherits:
-
Object
- Object
- FootballApi::Stats
- Defined in:
- lib/football_api/match_stats.rb
Instance Attribute Summary collapse
-
#corners ⇒ Object
Returns the value of attribute corners.
-
#fouls ⇒ Object
Returns the value of attribute fouls.
-
#offsides ⇒ Object
Returns the value of attribute offsides.
-
#ongoal_shots ⇒ Object
Returns the value of attribute ongoal_shots.
-
#possestiontime ⇒ Object
Returns the value of attribute possestiontime.
-
#redcards ⇒ Object
Returns the value of attribute redcards.
-
#saves ⇒ Object
Returns the value of attribute saves.
-
#total_shots ⇒ Object
Returns the value of attribute total_shots.
-
#yellowcards ⇒ Object
Returns the value of attribute yellowcards.
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ Stats
constructor
A new instance of Stats.
Constructor Details
#initialize(hash = {}) ⇒ Stats
Returns a new instance of Stats.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/football_api/match_stats.rb', line 17 def initialize(hash = {}) @total_shots = hash[:shots][:total] if hash[:shots] @ongoal_shots = hash[:shots][:ongoal] if hash[:shots] @fouls = hash[:fouls][:total] if hash[:fouls] @corners = hash[:corners][:total] if hash[:corners] @offsides = hash[:offsides][:total] if hash[:offsides] @possestiontime = hash[:possestiontime][:total] if hash[:possestiontime] @yellowcards = hash[:yellowcards][:total] if hash[:yellowcards] @redcards = hash[:redcards][:total] if hash[:redcards] @saves = hash[:saves][:total] if hash[:saves] end |
Instance Attribute Details
#corners ⇒ Object
Returns the value of attribute corners.
14 15 16 |
# File 'lib/football_api/match_stats.rb', line 14 def corners @corners end |
#fouls ⇒ Object
Returns the value of attribute fouls.
14 15 16 |
# File 'lib/football_api/match_stats.rb', line 14 def fouls @fouls end |
#offsides ⇒ Object
Returns the value of attribute offsides.
14 15 16 |
# File 'lib/football_api/match_stats.rb', line 14 def offsides @offsides end |
#ongoal_shots ⇒ Object
Returns the value of attribute ongoal_shots.
14 15 16 |
# File 'lib/football_api/match_stats.rb', line 14 def ongoal_shots @ongoal_shots end |
#possestiontime ⇒ Object
Returns the value of attribute possestiontime.
14 15 16 |
# File 'lib/football_api/match_stats.rb', line 14 def possestiontime @possestiontime end |
#redcards ⇒ Object
Returns the value of attribute redcards.
14 15 16 |
# File 'lib/football_api/match_stats.rb', line 14 def redcards @redcards end |
#saves ⇒ Object
Returns the value of attribute saves.
14 15 16 |
# File 'lib/football_api/match_stats.rb', line 14 def saves @saves end |
#total_shots ⇒ Object
Returns the value of attribute total_shots.
14 15 16 |
# File 'lib/football_api/match_stats.rb', line 14 def total_shots @total_shots end |
#yellowcards ⇒ Object
Returns the value of attribute yellowcards.
14 15 16 |
# File 'lib/football_api/match_stats.rb', line 14 def yellowcards @yellowcards end |