Class: Haml::Compiler::TagCompiler
- Inherits:
-
Object
- Object
- Haml::Compiler::TagCompiler
- Defined in:
- lib/haml/compiler/tag_compiler.rb
Instance Method Summary collapse
-
#compile(node, &block)
-
#initialize(identity, options) ⇒ TagCompiler
constructor
A new instance of TagCompiler.
Constructor Details
#initialize(identity, options) ⇒ TagCompiler
Returns a new instance of TagCompiler.
9 10 11 12 13 |
# File 'lib/haml/compiler/tag_compiler.rb', line 9
def initialize(identity, options)
@autoclose = options[:autoclose]
@identity = identity
@attribute_compiler = AttributeCompiler.new(identity, options)
end
|
Instance Method Details
#compile(node, &block)
15 16 17 18 19 |
# File 'lib/haml/compiler/tag_compiler.rb', line 15
def compile(node, &block)
attrs = @attribute_compiler.compile(node)
contents = compile_contents(node, &block)
[:html, :tag, node.value[:name], attrs, contents]
end
|