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.



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

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

Instance Method Details

#compile(node) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/hamlit/compiler/doctype_compiler.rb', line 8

def compile(node)
  case node.value[:type]
  when 'xml'
    xml_doctype
  when ''
    html_doctype(node)
  else
    [:html, :doctype, node.value[:type]]
  end
end