Class: Fortitude::Doctypes::Base

Inherits:
Object
  • Object
show all
Extended by:
Tags::TagStore
Defined in:
lib/fortitude/doctypes/base.rb

Direct Known Subclasses

Html4, Html5, UnknownDoctype, Xhtml10, Xhtml11

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Tags::TagStore

delegate_tag_stores, modify_tag, tag, tag_names, tags_added!, tags_changed!

Constructor Details

#initialize(name, doctype_line) ⇒ Base

Returns a new instance of Base


20
21
22
23
# File 'lib/fortitude/doctypes/base.rb', line 20

def initialize(name, doctype_line)
  @name = name
  @doctype_line = doctype_line
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


18
19
20
# File 'lib/fortitude/doctypes/base.rb', line 18

def name
  @name
end

Class Method Details

.delegate_tag_storesObject


9
10
11
12
13
14
15
# File 'lib/fortitude/doctypes/base.rb', line 9

def delegate_tag_stores
  if superclass.respond_to?(:tags)
    [ superclass ]
  else
    [ ]
  end
end

Instance Method Details

#close_void_tags_must_beObject


33
34
35
# File 'lib/fortitude/doctypes/base.rb', line 33

def close_void_tags_must_be
  nil
end

#declare!(w) ⇒ Object


29
30
31
# File 'lib/fortitude/doctypes/base.rb', line 29

def declare!(w)
  w.doctype(@doctype_line)
end

#tagsObject


25
26
27
# File 'lib/fortitude/doctypes/base.rb', line 25

def tags
  self.class.tags
end

#to_sObject


37
38
39
# File 'lib/fortitude/doctypes/base.rb', line 37

def to_s
  "<Doctype #{name.inspect}>"
end