class DMark::Translator

Attributes

out[R]

Public Class Methods

new(nodes) click to toggle source
# File lib/d-mark/translator.rb, line 5
def initialize(nodes)
  @nodes = nodes

  @out = ''
end

Public Instance Methods

run() click to toggle source
# File lib/d-mark/translator.rb, line 11
def run
  @nodes.each do |node|
    handle(node)
  end
  @out
end

Private Instance Methods

handle(_node) click to toggle source
# File lib/d-mark/translator.rb, line 20
def handle(_node)
  raise NotImplementedError
end
handle_children(node) click to toggle source
# File lib/d-mark/translator.rb, line 24
def handle_children(node)
  node.children.each { |child| handle(child) }
end