Class: SportDb::GoalStruct
- Inherits:
-
Object
- Object
- SportDb::GoalStruct
- Defined in:
- lib/sportdb/formats/goals.rb
Instance Attribute Summary collapse
-
#minute ⇒ Object
Returns the value of attribute minute.
-
#name ⇒ Object
flat struct for goals - one entry per goals.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#owngoal ⇒ Object
Returns the value of attribute owngoal.
-
#penalty ⇒ Object
Returns the value of attribute penalty.
-
#score1 ⇒ Object
gets calculated.
-
#score2 ⇒ Object
gets calculated.
-
#team ⇒ Object
1 or 2 ? check/todo: add team1 or team2 flag?.
Instance Method Summary collapse
- #==(o) ⇒ Object
-
#initialize(**kwargs) ⇒ GoalStruct
constructor
add/allow quick and dirty quick init with keywords.
- #state ⇒ Object
Constructor Details
#initialize(**kwargs) ⇒ GoalStruct
add/allow quick and dirty quick init with keywords
45 46 47 48 49 50 51 52 53 |
# File 'lib/sportdb/formats/goals.rb', line 45 def initialize( **kwargs ) ## add/allow quick and dirty quick init with keywords if kwargs.empty? # do nothing else kwargs.each do |key,value| send( "#{key}=", value ) end end end |
Instance Attribute Details
#minute ⇒ Object
Returns the value of attribute minute.
38 39 40 |
# File 'lib/sportdb/formats/goals.rb', line 38 def minute @minute end |
#name ⇒ Object
flat struct for goals - one entry per goals
36 37 38 |
# File 'lib/sportdb/formats/goals.rb', line 36 def name @name end |
#offset ⇒ Object
Returns the value of attribute offset.
38 39 40 |
# File 'lib/sportdb/formats/goals.rb', line 38 def offset @offset end |
#owngoal ⇒ Object
Returns the value of attribute owngoal.
39 40 41 |
# File 'lib/sportdb/formats/goals.rb', line 39 def owngoal @owngoal end |
#penalty ⇒ Object
Returns the value of attribute penalty.
39 40 41 |
# File 'lib/sportdb/formats/goals.rb', line 39 def penalty @penalty end |
#score1 ⇒ Object
gets calculated
40 41 42 |
# File 'lib/sportdb/formats/goals.rb', line 40 def score1 @score1 end |
#score2 ⇒ Object
gets calculated
40 41 42 |
# File 'lib/sportdb/formats/goals.rb', line 40 def score2 @score2 end |
#team ⇒ Object
1 or 2 ? check/todo: add team1 or team2 flag?
37 38 39 |
# File 'lib/sportdb/formats/goals.rb', line 37 def team @team end |
Instance Method Details
#==(o) ⇒ Object
55 56 57 |
# File 'lib/sportdb/formats/goals.rb', line 55 def ==(o) o.class == self.class && o.state == state end |
#state ⇒ Object
59 60 61 |
# File 'lib/sportdb/formats/goals.rb', line 59 def state [@name, @team, @minute, @offset, @penalty, @owngoal, @score1, @score2] end |