Class: RaccMatchParser::GoalMinute
- Inherits:
-
Struct
- Object
- Struct
- RaccMatchParser::GoalMinute
- Defined in:
- lib/sportdb/parser/racc_tree.rb
Overview
FIX/FIX/FIX
split into Minute and
GoalMinute (Minute+GoalType)
fix - move :og, :pen to Goal if possible - why? why not?
or change to GoalMinute ???
fix!!! split into GoalMinute and Minute
goal_minute incl. :og, :pen, :freekick, :header,
seconds etc.
GoalMinute = Minute + GoalType !!!
Instance Attribute Summary collapse
-
#freekick ⇒ Object
Returns the value of attribute freekick.
-
#header ⇒ Object
Returns the value of attribute header.
-
#m ⇒ Object
Returns the value of attribute m.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#og ⇒ Object
Returns the value of attribute og.
-
#pen ⇒ Object
Returns the value of attribute pen.
-
#secs ⇒ Object
Returns the value of attribute secs.
Instance Method Summary collapse
- #pretty_print(printer) ⇒ Object
- #to_goal_type ⇒ Object
-
#to_minute ⇒ Object
quick hack: split struct into Minute+GoalType structs.
- #to_s ⇒ Object
Instance Attribute Details
#freekick ⇒ Object
Returns the value of attribute freekick
473 474 475 |
# File 'lib/sportdb/parser/racc_tree.rb', line 473 def freekick @freekick end |
#header ⇒ Object
Returns the value of attribute header
473 474 475 |
# File 'lib/sportdb/parser/racc_tree.rb', line 473 def header @header end |
#m ⇒ Object
Returns the value of attribute m
473 474 475 |
# File 'lib/sportdb/parser/racc_tree.rb', line 473 def m @m end |
#offset ⇒ Object
Returns the value of attribute offset
473 474 475 |
# File 'lib/sportdb/parser/racc_tree.rb', line 473 def offset @offset end |
#og ⇒ Object
Returns the value of attribute og
473 474 475 |
# File 'lib/sportdb/parser/racc_tree.rb', line 473 def og @og end |
#pen ⇒ Object
Returns the value of attribute pen
473 474 475 |
# File 'lib/sportdb/parser/racc_tree.rb', line 473 def pen @pen end |
#secs ⇒ Object
Returns the value of attribute secs
473 474 475 |
# File 'lib/sportdb/parser/racc_tree.rb', line 473 def secs @secs end |
Instance Method Details
#pretty_print(printer) ⇒ Object
489 490 491 |
# File 'lib/sportdb/parser/racc_tree.rb', line 489 def pretty_print( printer ) printer.text( to_s ) end |
#to_goal_type ⇒ Object
501 502 503 504 505 506 507 508 509 510 |
# File 'lib/sportdb/parser/racc_tree.rb', line 501 def to_goal_type if self.og || self.pen || self.header || self.freekick GoalType.new( og: self.og, pen: self.pen, header: self.header, freekick: self.freekick ) else nil ## note - return nil; if no goal type present!! end end |
#to_minute ⇒ Object
quick hack: split struct into Minute+GoalType structs
495 496 497 498 499 |
# File 'lib/sportdb/parser/racc_tree.rb', line 495 def to_minute Minute.new( m: self.m, offset: self.offset, secs: self.secs ) end |
#to_s ⇒ Object
476 477 478 479 480 481 482 483 484 485 486 487 |
# File 'lib/sportdb/parser/racc_tree.rb', line 476 def to_s buf = String.new buf << "#{self.m}" buf << "'" buf << "+#{self.offset}" if self.offset buf << " (og)" if self.og buf << " (pen)" if self.pen buf << " (f)" if self.freekick buf << " (h)" if self.header buf << " (#{self.secs} secs)" if self.secs buf end |