Class: DMark::Translator

Inherits:
Object
  • Object
show all
Defined in:
lib/d-mark/translator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nodes) ⇒ Translator

Returns a new instance of Translator.



5
6
7
8
9
# File 'lib/d-mark/translator.rb', line 5

def initialize(nodes)
  @nodes = nodes

  @out = ''
end

Instance Attribute Details

#outObject (readonly)

Returns the value of attribute out.



3
4
5
# File 'lib/d-mark/translator.rb', line 3

def out
  @out
end

Instance Method Details

#runObject



11
12
13
14
15
16
# File 'lib/d-mark/translator.rb', line 11

def run
  @nodes.each do |node|
    handle(node)
  end
  @out
end