Class: Haml::Generator
- Inherits:
-
Object
- Object
- Haml::Generator
- Includes:
- Temple::Mixins::CompiledDispatcher, Temple::Mixins::Options
- Defined in:
- lib/haml/generator.rb
Overview
Ruby code generator, which is a limited version of Temple::Generator. Limit methods since Haml doesn't need most of them.
Instance Method Summary collapse
Instance Method Details
#call(exp)
11 12 13 |
# File 'lib/haml/generator.rb', line 11
def call(exp)
compile(exp)
end
|
#on_code(exp)
27 28 29 |
# File 'lib/haml/generator.rb', line 27
def on_code(exp)
exp
end
|
#on_dynamic(code)
23 24 25 |
# File 'lib/haml/generator.rb', line 23
def on_dynamic(code)
concat(code)
end
|
#on_multi(*exp)
15 16 17 |
# File 'lib/haml/generator.rb', line 15
def on_multi(*exp)
exp.map { |e| compile(e) }.join('; ')
end
|
#on_newline
31 32 33 |
# File 'lib/haml/generator.rb', line 31
def on_newline
"\n"
end
|
#on_static(text)
19 20 21 |
# File 'lib/haml/generator.rb', line 19
def on_static(text)
concat(options[:freeze_static] ? "#{Util.inspect_obj(text)}.freeze" : Util.inspect_obj(text))
end
|