Class: SyntaxTree::XML::ExternalID
- Defined in:
- lib/syntax_tree/xml/nodes.rb
Overview
An external ID is a child of a document type declaration. It represents the location where the external identifier is located. It contains a type (either system or public), an optional public id literal, and the system literal.
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#public_id ⇒ Object
readonly
Returns the value of attribute public_id.
-
#system_id ⇒ Object
readonly
Returns the value of attribute system_id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(type:, public_id:, system_id:, location:) ⇒ ExternalID
constructor
A new instance of ExternalID.
Methods inherited from Node
Constructor Details
#initialize(type:, public_id:, system_id:, location:) ⇒ ExternalID
Returns a new instance of ExternalID.
188 189 190 191 192 |
# File 'lib/syntax_tree/xml/nodes.rb', line 188 def initialize(type:, public_id:, system_id:, location:) @type = type @public_id = public_id @system_id = system_id end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
186 187 188 |
# File 'lib/syntax_tree/xml/nodes.rb', line 186 def location @location end |
#public_id ⇒ Object (readonly)
Returns the value of attribute public_id.
186 187 188 |
# File 'lib/syntax_tree/xml/nodes.rb', line 186 def public_id @public_id end |
#system_id ⇒ Object (readonly)
Returns the value of attribute system_id.
186 187 188 |
# File 'lib/syntax_tree/xml/nodes.rb', line 186 def system_id @system_id end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
186 187 188 |
# File 'lib/syntax_tree/xml/nodes.rb', line 186 def type @type end |
Instance Method Details
#accept(visitor) ⇒ Object
194 195 196 |
# File 'lib/syntax_tree/xml/nodes.rb', line 194 def accept(visitor) visitor.visit_external_id(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
198 199 200 |
# File 'lib/syntax_tree/xml/nodes.rb', line 198 def child_nodes [type, public_id, system_id].compact end |
#deconstruct_keys(keys) ⇒ Object
204 205 206 207 208 209 210 211 |
# File 'lib/syntax_tree/xml/nodes.rb', line 204 def deconstruct_keys(keys) { type: type, public_id: public_id, system_id: system_id, location: location } end |