Class: RaccMatchParser::GoalAlt

Inherits:
Struct
  • Object
show all
Defined in:
lib/sportdb/parser/racc_tree.rb

Overview

score and player REQUIRED

note - (goal) minute is optional
       if no minute goal type is optional e.g. "standalone" (p), (og), etc.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#goal_typeObject

Returns the value of attribute goal_type

Returns:

  • (Object)

    the current value of goal_type



414
415
416
# File 'lib/sportdb/parser/racc_tree.rb', line 414

def goal_type
  @goal_type
end

#minuteObject

Returns the value of attribute minute

Returns:

  • (Object)

    the current value of minute



414
415
416
# File 'lib/sportdb/parser/racc_tree.rb', line 414

def minute
  @minute
end

#playerObject

Returns the value of attribute player

Returns:

  • (Object)

    the current value of player



414
415
416
# File 'lib/sportdb/parser/racc_tree.rb', line 414

def player
  @player
end

#scoreObject

Returns the value of attribute score

Returns:

  • (Object)

    the current value of score



414
415
416
# File 'lib/sportdb/parser/racc_tree.rb', line 414

def score
  @score
end

Instance Method Details

#pretty_print(printer) ⇒ Object



424
425
426
# File 'lib/sportdb/parser/racc_tree.rb', line 424

def pretty_print( printer )
  printer.text( to_s )
end

#to_sObject



415
416
417
418
419
420
421
422
# File 'lib/sportdb/parser/racc_tree.rb', line 415

def to_s
  buf = String.new
  buf << "#{self.score[0]}-#{self.score[1]}"
  buf << " #{self.player}"
  buf << " #{self.minute}"     if self.minute
  buf << " #{self.goal_type}"  if self.goal_type
  buf
end