Class: RaccMatchParser::Goal

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

Overview

change/rename Goal to GoalScorer - why? why not?

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countObject

Returns the value of attribute count

Returns:

  • (Object)

    the current value of count



337
338
339
# File 'lib/sportdb/parser/racc_tree.rb', line 337

def count
  @count
end

#minutesObject

Returns the value of attribute minutes

Returns:

  • (Object)

    the current value of minutes



337
338
339
# File 'lib/sportdb/parser/racc_tree.rb', line 337

def minutes
  @minutes
end

#playerObject

Returns the value of attribute player

Returns:

  • (Object)

    the current value of player



337
338
339
# File 'lib/sportdb/parser/racc_tree.rb', line 337

def player
  @player
end

Instance Method Details

#pretty_print(printer) ⇒ Object



354
355
356
# File 'lib/sportdb/parser/racc_tree.rb', line 354

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

#to_sObject



338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/sportdb/parser/racc_tree.rb', line 338

def to_s
  buf = String.new
  buf << "#{self.player}"
  if count
     buf << (" " + count.pretty_inspect + ",")
  else
    if minutes.nil? || minutes.empty?
      ## add nothing if no minutes available/present
    else
      buf << " "
      buf << minutes.map { |min| min.to_s }.join(' ')
    end
  end
  buf
end