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



25
26
27
# File 'lib/sportdb/parser/racc_tree.rb', line 25

def name
  @name
end

#noteObject

Returns the value of attribute note

Returns:

  • (Object)

    the current value of note



25
26
27
# File 'lib/sportdb/parser/racc_tree.rb', line 25

def note
  @note
end

#scoreObject

Returns the value of attribute score

Returns:

  • (Object)

    the current value of score



25
26
27
# File 'lib/sportdb/parser/racc_tree.rb', line 25

def score
  @score
end

Instance Method Details

#pretty_print(printer) ⇒ Object



34
35
36
# File 'lib/sportdb/parser/racc_tree.rb', line 34

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

#to_sObject



26
27
28
29
30
31
32
# File 'lib/sportdb/parser/racc_tree.rb', line 26

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