class SportDb::GoalStruct

Attributes

minute[RW]
name[RW]

flat struct for goals - one entry per goals

offset[RW]
owngoal[RW]
penalty[RW]
score1[RW]
score2[RW]
team[RW]

Public Class Methods

new( **kwargs ) click to toggle source

add pos for sequence number? e.g. 1,2,3,4 (1st goald, 2nd goal, etc.) ???

# 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

Public Instance Methods

==(o) click to toggle source
# File lib/sportdb/formats/goals.rb, line 55
def ==(o)
  o.class == self.class && o.state == state
end
state() click to toggle source
# File lib/sportdb/formats/goals.rb, line 59
def state
  [@name, @team, @minute, @offset, @penalty, @owngoal, @score1, @score2]
end