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