Class: Fbtxt::Parser::GoalCompat
- Defined in:
- lib/fbtxt/parser/parse_tree-match.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
197 198 199 |
# File 'lib/fbtxt/parser/parse_tree-match.rb', line 197 def goal_type @goal_type end |
#minute ⇒ Object
Returns the value of attribute minute
197 198 199 |
# File 'lib/fbtxt/parser/parse_tree-match.rb', line 197 def minute @minute end |
#player ⇒ Object
Returns the value of attribute player
197 198 199 |
# File 'lib/fbtxt/parser/parse_tree-match.rb', line 197 def player @player end |
#score ⇒ Object
Returns the value of attribute score
197 198 199 |
# File 'lib/fbtxt/parser/parse_tree-match.rb', line 197 def score @score end |
Instance Method Details
#pretty_print(q) ⇒ Object
207 208 209 |
# File 'lib/fbtxt/parser/parse_tree-match.rb', line 207 def pretty_print( q ) q.text( to_s ) end |
#to_s ⇒ Object
198 199 200 201 202 203 204 205 |
# File 'lib/fbtxt/parser/parse_tree-match.rb', line 198 def to_s buf = String.new buf << "#{minute}" buf << " #{player}" buf << " #{goal_type}" if goal_type buf << " #{score[0]}-#{score[1]}" if score buf end |