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



32
33
34
# File 'lib/sportdb/parser/racc_tree.rb', line 32

def name
  @name
end

#noteObject

Returns the value of attribute note

Returns:

  • (Object)

    the current value of note



32
33
34
# File 'lib/sportdb/parser/racc_tree.rb', line 32

def note
  @note
end

#scoreObject

Returns the value of attribute score

Returns:

  • (Object)

    the current value of score



32
33
34
# File 'lib/sportdb/parser/racc_tree.rb', line 32

def score
  @score
end

Instance Method Details

#pretty_print(printer) ⇒ Object



41
42
43
# File 'lib/sportdb/parser/racc_tree.rb', line 41

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

#to_sObject



33
34
35
36
37
38
39
# File 'lib/sportdb/parser/racc_tree.rb', line 33

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