Class: Hamlit::Compiler::DoctypeCompiler

Inherits:
Object
  • Object
show all
Defined in:
lib/hamlit/compiler/doctype_compiler.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ DoctypeCompiler

Returns a new instance of DoctypeCompiler.


5
6
7
# File 'lib/hamlit/compiler/doctype_compiler.rb', line 5

def initialize(options = {})
  @format = options[:format]
end

Instance Method Details

#compile(node) ⇒ Object


9
10
11
12
13
14
15
16
17
18
# File 'lib/hamlit/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