Class: Haml::Compiler::DoctypeCompiler
- Inherits:
-
Object
- Object
- Haml::Compiler::DoctypeCompiler
- Defined in:
- lib/haml/compiler/doctype_compiler.rb
Instance Method Summary collapse
- #compile(node) ⇒ Object
-
#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( = {}) @format = [:format] end |
Instance Method Details
#compile(node) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/haml/compiler/doctype_compiler.rb', line 9 def compile(node) case node.value[:type] when 'xml' xml_doctype when '' html_doctype(node) else [:html, :doctype, node.value[:type]] end end |