Class: EZML::Generator

Inherits:
Object show all
Includes:
Temple::Mixins::CompiledDispatcher, Temple::Mixins::Options
Defined in:
lib/ezml/generator.rb

Instance Method Summary collapse

Instance Method Details

#call(exp) ⇒ Object



8
9
10
# File 'lib/ezml/generator.rb', line 8

def call(exp)
  compile(exp)
end

#on_code(exp) ⇒ Object



24
25
26
# File 'lib/ezml/generator.rb', line 24

def on_code(exp)
  exp
end

#on_dynamic(code) ⇒ Object



20
21
22
# File 'lib/ezml/generator.rb', line 20

def on_dynamic(code)
  concat(code)
end

#on_multi(*exp) ⇒ Object



12
13
14
# File 'lib/ezml/generator.rb', line 12

def on_multi(*exp)
  exp.map { |e| compile(e) }.join('; ')
end

#on_newlineObject



28
29
30
# File 'lib/ezml/generator.rb', line 28

def on_newline
  "\n"
end

#on_static(text) ⇒ Object



16
17
18
# File 'lib/ezml/generator.rb', line 16

def on_static(text)
  concat(options[:freeze_static] ? "#{Util.inspect_obj(text)}.freeze" : Util.inspect_obj(text))
end