class HTMLWriter

Turns a tree of tokens into it's corresponding HTML output.

Public Class Methods

new(token_tree) click to toggle source
# File lib/rosetta/formatters/html/html_writer.rb, line 8
def initialize(token_tree)
  @token_tree = token_tree
end

Public Instance Methods

call() click to toggle source
# File lib/rosetta/formatters/html/html_writer.rb, line 12
def call
  @token_tree.map { |token| html_generator.generate(token) }.compact.join
end
html_generator() click to toggle source
# File lib/rosetta/formatters/html/html_writer.rb, line 16
def html_generator
  @html_generator ||= HTMLGenerator.new
end