Class: RaccMatchParser::GoalCompat
- Inherits:
-
Struct
- Object
- Struct
- RaccMatchParser::GoalCompat
- 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
-
#goal_type ⇒ Object
Returns the value of attribute goal_type.
-
#minute ⇒ Object
Returns the value of attribute minute.
-
#player ⇒ Object
Returns the value of attribute player.
-
#score ⇒ Object
Returns the value of attribute score.
Instance Method Summary collapse
Instance Attribute Details
#goal_type ⇒ Object
Returns the value of attribute goal_type
410 411 412 |
# File 'lib/sportdb/parser/racc_tree.rb', line 410 def goal_type @goal_type end |
#minute ⇒ Object
Returns the value of attribute minute
410 411 412 |
# File 'lib/sportdb/parser/racc_tree.rb', line 410 def minute @minute end |
#player ⇒ Object
Returns the value of attribute player
410 411 412 |
# File 'lib/sportdb/parser/racc_tree.rb', line 410 def player @player end |
#score ⇒ Object
Returns the value of attribute score
410 411 412 |
# File 'lib/sportdb/parser/racc_tree.rb', line 410 def score @score end |
Instance Method Details
#pretty_print(printer) ⇒ Object
420 421 422 |
# File 'lib/sportdb/parser/racc_tree.rb', line 420 def pretty_print( printer ) printer.text( to_s ) end |
#to_s ⇒ Object
411 412 413 414 415 416 417 418 |
# File 'lib/sportdb/parser/racc_tree.rb', line 411 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 |