Class: RaccMatchParser::Penalty

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



57
58
59
# File 'lib/sportdb/parser/racc_tree.rb', line 57

def name
  @name
end

#noteObject

Returns the value of attribute note

Returns:

  • (Object)

    the current value of note



57
58
59
# File 'lib/sportdb/parser/racc_tree.rb', line 57

def note
  @note
end

#scoreObject

Returns the value of attribute score

Returns:

  • (Object)

    the current value of score



57
58
59
# File 'lib/sportdb/parser/racc_tree.rb', line 57

def score
  @score
end

Instance Method Details

#pretty_print(printer) ⇒ Object



67
68
69
# File 'lib/sportdb/parser/racc_tree.rb', line 67

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

#to_sObject



58
59
60
61
62
63
64
# File 'lib/sportdb/parser/racc_tree.rb', line 58

def to_s
  buf = String.new
  buf << "#{self.score[0]}-#{self.score[1]} "   if self.score
  buf <<  self.name
  buf << " (#{self.note})"    if self.note 
  buf
end