Class: MinimalMarkdown::HtmlRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/minimal_markdown/html_renderer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tree) ⇒ HtmlRenderer

Returns a new instance of HtmlRenderer.



5
6
7
# File 'lib/minimal_markdown/html_renderer.rb', line 5

def initialize(tree)
  @tree = tree
end

Instance Attribute Details

#treeObject (readonly)

Returns the value of attribute tree.



3
4
5
# File 'lib/minimal_markdown/html_renderer.rb', line 3

def tree
  @tree
end

Instance Method Details

#renderObject



9
10
11
12
13
# File 'lib/minimal_markdown/html_renderer.rb', line 9

def render
  output = ''
  tree.each { |node| node.render(output) }
  output
end