Class: RaccMatchParser::GoalCompat

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

Overview

minute and player REQUIRED

note - score (e.g. 1-1) is optional
       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



443
444
445
# File 'lib/sportdb/parser/racc_tree.rb', line 443

def goal_type
  @goal_type
end

#minuteObject

Returns the value of attribute minute

Returns:

  • (Object)

    the current value of minute



443
444
445
# File 'lib/sportdb/parser/racc_tree.rb', line 443

def minute
  @minute
end

#playerObject

Returns the value of attribute player

Returns:

  • (Object)

    the current value of player



443
444
445
# File 'lib/sportdb/parser/racc_tree.rb', line 443

def player
  @player
end

#scoreObject

Returns the value of attribute score

Returns:

  • (Object)

    the current value of score



443
444
445
# File 'lib/sportdb/parser/racc_tree.rb', line 443

def score
  @score
end

Instance Method Details

#pretty_print(printer) ⇒ Object



453
454
455
# File 'lib/sportdb/parser/racc_tree.rb', line 453

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

#to_sObject



444
445
446
447
448
449
450
451
# File 'lib/sportdb/parser/racc_tree.rb', line 444

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