Class: Cadenza::SourceTreeRenderer

Inherits:
BaseRenderer show all
Defined in:
lib/cadenza/source_tree_renderer.rb

Instance Attribute Summary

Attributes inherited from BaseRenderer

#error_handler, #output

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseRenderer

#render

Constructor Details

#initialize(*args) ⇒ SourceTreeRenderer

Returns a new instance of SourceTreeRenderer.


13
14
15
16
# File 'lib/cadenza/source_tree_renderer.rb', line 13

def initialize(*args)
   @level = 0
   super
end

Class Method Details

.render(document_node, context = {}) ⇒ Object

TODO: move this to a module


7
8
9
10
11
# File 'lib/cadenza/source_tree_renderer.rb', line 7

def self.render(document_node, context={})
   io = StringIO.new
   new(io).render(document_node, context)
   io.string
end