Class: Oga::XML::Doctype
Overview
Class used for storing information about Doctypes.
Instance Attribute Summary collapse
-
#inline_rules ⇒ String
The inline doctype rules.
-
#name ⇒ String
The name of the doctype (e.g. “HTML”).
-
#public_id ⇒ String
The public ID of the doctype.
-
#system_id ⇒ String
The system ID of the doctype.
-
#type ⇒ String
The type of the doctype (e.g. “PUBLIC”).
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Doctype
constructor
A new instance of Doctype.
-
#inspect ⇒ String
Inspects the doctype.
Methods inherited from Node
#after, #before, #children, #children=, #each_ancestor, #html?, #next_element, #parent, #previous_element, #remove, #replace, #root_node, #xml?
Methods included from ToXML
Methods included from Traversal
Constructor Details
#initialize(options = {}) ⇒ Doctype
Returns a new instance of Doctype
34 35 36 37 38 39 40 |
# File 'lib/oga/xml/doctype.rb', line 34 def initialize( = {}) @name = [:name] @type = [:type] @public_id = [:public_id] @system_id = [:system_id] @inline_rules = [:inline_rules] end |
Instance Attribute Details
#inline_rules ⇒ String
The inline doctype rules.
23 24 25 |
# File 'lib/oga/xml/doctype.rb', line 23 def inline_rules @inline_rules end |
#name ⇒ String
The name of the doctype (e.g. “HTML”).
7 8 9 |
# File 'lib/oga/xml/doctype.rb', line 7 def name @name end |
#public_id ⇒ String
The public ID of the doctype.
15 16 17 |
# File 'lib/oga/xml/doctype.rb', line 15 def public_id @public_id end |
#system_id ⇒ String
The system ID of the doctype.
19 20 21 |
# File 'lib/oga/xml/doctype.rb', line 19 def system_id @system_id end |
#type ⇒ String
The type of the doctype (e.g. “PUBLIC”).
11 12 13 |
# File 'lib/oga/xml/doctype.rb', line 11 def type @type end |
Instance Method Details
#inspect ⇒ String
Inspects the doctype.
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/oga/xml/doctype.rb', line 45 def inspect segments = [] [:name, :type, :public_id, :system_id, :inline_rules].each do |attr| value = send(attr) if value and !value.empty? segments << "#{attr}: #{value.inspect}" end end "Doctype(#{segments.join(' ')})" end |