Class: Bade::AST::DoctypeNode

Inherits:
ValueNode show all
Defined in:
lib/bade/ast/node/doctype_node.rb

Instance Attribute Summary

Attributes inherited from ValueNode

#conditional, #default_value, #escaped, #value

Attributes inherited from Node

#children, #filename, #lineno, #parent, #type

Instance Method Summary collapse

Methods inherited from ValueNode

#==

Methods inherited from Node

#==, #initialize, #inspect, #to_s

Constructor Details

This class inherits a constructor from Bade::AST::Node

Instance Method Details

#xml_outputString

Returns:



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/bade/ast/node/doctype_node.rb', line 11

def xml_output
  case value
  when 'xml'
    '<?xml version="1.0" encoding="utf-8" ?>'

  when 'html'
    '<!DOCTYPE html>'

  else
    raise Parser::ParserInternalError, 'Unknown doctype type'
  end
end