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



370
371
372
# File 'lib/sportdb/parser/racc_tree.rb', line 370

def count
  @count
end

#minutesObject

Returns the value of attribute minutes

Returns:

  • (Object)

    the current value of minutes



370
371
372
# File 'lib/sportdb/parser/racc_tree.rb', line 370

def minutes
  @minutes
end

#playerObject

Returns the value of attribute player

Returns:

  • (Object)

    the current value of player



370
371
372
# File 'lib/sportdb/parser/racc_tree.rb', line 370

def player
  @player
end

Instance Method Details

#pretty_print(printer) ⇒ Object



387
388
389
# File 'lib/sportdb/parser/racc_tree.rb', line 387

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

#to_sObject



371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
# File 'lib/sportdb/parser/racc_tree.rb', line 371

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