Class: Haml::Compiler::DoctypeCompiler
- Inherits:
-
Object
- Object
- Haml::Compiler::DoctypeCompiler
- Defined in:
- lib/haml/compiler/doctype_compiler.rb
Instance Method Summary collapse
- #compile(node)
-
#initialize(options = {}) ⇒ DoctypeCompiler
constructor
A new instance of DoctypeCompiler.
Constructor Details
#initialize(options = {}) ⇒ DoctypeCompiler
Returns a new instance of DoctypeCompiler.
5 6 7 |
# File 'lib/haml/compiler/doctype_compiler.rb', line 5
def initialize(options = {})
@format = options[:format]
end
|
Instance Method Details
#compile(node)
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/haml/compiler/doctype_compiler.rb', line 9
def compile(node)
case node.value[:type]
when ''
html_doctype(node)
when 'xml'
xml_doctype
when 'rdfa'
rdfa_doctype
else
[:html, :doctype, node.value[:type]]
end
end
|