Module: Fortitude::Doctypes

Defined in:
lib/fortitude/doctypes.rb,
lib/fortitude/doctypes/base.rb,
lib/fortitude/doctypes/html4.rb,
lib/fortitude/doctypes/html5.rb,
lib/fortitude/doctypes/xhtml10.rb,
lib/fortitude/doctypes/xhtml11.rb,
lib/fortitude/doctypes/html4_strict.rb,
lib/fortitude/doctypes/html4_frameset.rb,
lib/fortitude/doctypes/xhtml10_strict.rb,
lib/fortitude/doctypes/unknown_doctype.rb,
lib/fortitude/doctypes/xhtml10_frameset.rb,
lib/fortitude/doctypes/html4_tags_strict.rb,
lib/fortitude/doctypes/html4_transitional.rb,
lib/fortitude/doctypes/html4_tags_frameset.rb,
lib/fortitude/doctypes/xhtml10_transitional.rb,
lib/fortitude/doctypes/html4_tags_transitional.rb

Defined Under Namespace

Modules: Html4TagsFrameset, Html4TagsStrict, Html4TagsTransitional Classes: Base, Html4, Html4Frameset, Html4Strict, Html4Transitional, Html5, UnknownDoctype, Xhtml10, Xhtml10Frameset, Xhtml10Strict, Xhtml10Transitional, Xhtml11

Constant Summary collapse

KNOWN_DOCTYPES =
begin
  out = { }

  [
    Html5,

    Html4Strict,
    Html4Transitional,
    Html4Frameset,

    Xhtml10Strict,
    Xhtml10Transitional,
    Xhtml10Frameset,

    Xhtml11
  ].each do |doctype_class|
    doctype = doctype_class.new
    out[doctype.name] = doctype
  end

  out
end

Class Method Summary collapse

Class Method Details

.standard_doctype(type) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/fortitude/doctypes.rb', line 39

def standard_doctype(type)
  out = KNOWN_DOCTYPES[type]
  unless out
    raise ArgumentError, "Unknown standard doctype #{type.inspect}; I know about: #{KNOWN_DOCTYPES.keys.inspect}"
  end
  out
end