Class: SportDb::Parser::GoalMinute
- Defined in:
- lib/sportdb/parser/parse_tree-match.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
- #as_json ⇒ Object
- #pretty_print(q) ⇒ 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
227 228 229 |
# File 'lib/sportdb/parser/parse_tree-match.rb', line 227 def freekick @freekick end |
#header ⇒ Object
Returns the value of attribute header
227 228 229 |
# File 'lib/sportdb/parser/parse_tree-match.rb', line 227 def header @header end |
#m ⇒ Object
Returns the value of attribute m
227 228 229 |
# File 'lib/sportdb/parser/parse_tree-match.rb', line 227 def m @m end |
#offset ⇒ Object
Returns the value of attribute offset
227 228 229 |
# File 'lib/sportdb/parser/parse_tree-match.rb', line 227 def offset @offset end |
#og ⇒ Object
Returns the value of attribute og
227 228 229 |
# File 'lib/sportdb/parser/parse_tree-match.rb', line 227 def og @og end |
#pen ⇒ Object
Returns the value of attribute pen
227 228 229 |
# File 'lib/sportdb/parser/parse_tree-match.rb', line 227 def pen @pen end |
#secs ⇒ Object
Returns the value of attribute secs
227 228 229 |
# File 'lib/sportdb/parser/parse_tree-match.rb', line 227 def secs @secs end |
Instance Method Details
#as_json ⇒ Object
232 |
# File 'lib/sportdb/parser/parse_tree-match.rb', line 232 def as_json(*) to_s; end |
#pretty_print(q) ⇒ Object
247 248 249 |
# File 'lib/sportdb/parser/parse_tree-match.rb', line 247 def pretty_print( q ) q.text( to_s ) end |
#to_goal_type ⇒ Object
259 260 261 262 263 264 265 266 267 268 |
# File 'lib/sportdb/parser/parse_tree-match.rb', line 259 def to_goal_type if og || pen || header || freekick GoalType.new( og: og, pen: pen, header: header, freekick: freekick ) else nil ## note - return nil; if no goal type present!! end end |
#to_minute ⇒ Object
quick hack: split struct into Minute+GoalType structs
253 254 255 256 257 |
# File 'lib/sportdb/parser/parse_tree-match.rb', line 253 def to_minute Minute.new( m: m, offset: offset, secs: secs ) end |
#to_s ⇒ Object
234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/sportdb/parser/parse_tree-match.rb', line 234 def to_s buf = String.new buf << "#{m}" buf << "'" buf << "+#{offset}" if offset buf << "(og)" if og buf << "(p)" if pen buf << "(f)" if freekick buf << "(h)" if header buf << " (#{secs} secs)" if secs buf end |