Class: FootballApi::Goal
- Inherits:
-
Object
- Object
- FootballApi::Goal
- Defined in:
- lib/football_api/goal.rb
Instance Attribute Summary collapse
-
#minute ⇒ Object
Returns the value of attribute minute.
-
#owngoal ⇒ Object
Returns the value of attribute owngoal.
-
#penalty ⇒ Object
Returns the value of attribute penalty.
-
#player ⇒ Object
Returns the value of attribute player.
-
#score ⇒ Object
Returns the value of attribute score.
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ Goal
constructor
A new instance of Goal.
- #parse_player(hash = {}) ⇒ Object
Constructor Details
#initialize(hash = {}) ⇒ Goal
Returns a new instance of Goal.
5 6 7 8 9 10 11 |
# File 'lib/football_api/goal.rb', line 5 def initialize(hash = {}) @score = hash[:score] @minute = hash[:minute] @owngoal = hash[:owngoal] @penalty = hash[:penalty] @player = parse_player(hash) end |
Instance Attribute Details
#minute ⇒ Object
Returns the value of attribute minute.
3 4 5 |
# File 'lib/football_api/goal.rb', line 3 def minute @minute end |
#owngoal ⇒ Object
Returns the value of attribute owngoal.
3 4 5 |
# File 'lib/football_api/goal.rb', line 3 def owngoal @owngoal end |
#penalty ⇒ Object
Returns the value of attribute penalty.
3 4 5 |
# File 'lib/football_api/goal.rb', line 3 def penalty @penalty end |
#player ⇒ Object
Returns the value of attribute player.
3 4 5 |
# File 'lib/football_api/goal.rb', line 3 def player @player end |
#score ⇒ Object
Returns the value of attribute score.
3 4 5 |
# File 'lib/football_api/goal.rb', line 3 def score @score end |
Instance Method Details
#parse_player(hash = {}) ⇒ Object
13 14 15 |
# File 'lib/football_api/goal.rb', line 13 def parse_player(hash = {}) FootballApi::Player.new(hash) end |