Class: Kwaff::Node
- Inherits:
-
Object
- Object
- Kwaff::Node
- Defined in:
- lib/kwaff/node.rb,
lib/kwaff/rexml.rb
Overview
abstract class
Instance Attribute Summary collapse
-
#empty_lines ⇒ Object
Returns the value of attribute empty_lines.
Instance Method Summary collapse
-
#accept(translator, level = 0) ⇒ Object
abstract method.
-
#initialize ⇒ Node
constructor
A new instance of Node.
- #to_rexml(toppings = {}) ⇒ Object
- #to_xml(toppings = {}) ⇒ Object
Constructor Details
#initialize ⇒ Node
Returns a new instance of Node.
26 27 28 |
# File 'lib/kwaff/node.rb', line 26 def initialize() @empty_lines = 0 end |
Instance Attribute Details
#empty_lines ⇒ Object
Returns the value of attribute empty_lines.
30 31 32 |
# File 'lib/kwaff/node.rb', line 30 def empty_lines @empty_lines end |
Instance Method Details
#accept(translator, level = 0) ⇒ Object
abstract method
17 18 19 |
# File 'lib/kwaff/node.rb', line 17 def accept(translator, level=0) raise NotImplementedError.new("#{self.class.name}#accept() is not implemented.") end |
#to_rexml(toppings = {}) ⇒ Object
20 21 22 23 |
# File 'lib/kwaff/rexml.rb', line 20 def to_rexml(toppings={}) translator = Kwaff::RexmlTranslator.new(toppings) return translator ? translator.translate(self) : nil end |
#to_xml(toppings = {}) ⇒ Object
21 22 23 24 |
# File 'lib/kwaff/node.rb', line 21 def to_xml(toppings={}) translator = XmlTranslator.new(toppings) return translator ? translator.translate(self) : nil end |