Class: SyntaxTree::XML::Prolog
- Defined in:
- lib/syntax_tree/xml/nodes.rb
Overview
The prolog to the document includes an XML declaration which opens the tag, any number of attributes, and a closing of the tag.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#closing ⇒ Object
readonly
Returns the value of attribute closing.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#opening ⇒ Object
readonly
Returns the value of attribute opening.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(opening:, attributes:, closing:, location:) ⇒ Prolog
constructor
A new instance of Prolog.
Methods inherited from Node
Constructor Details
#initialize(opening:, attributes:, closing:, location:) ⇒ Prolog
Returns a new instance of Prolog.
118 119 120 121 122 123 |
# File 'lib/syntax_tree/xml/nodes.rb', line 118 def initialize(opening:, attributes:, closing:, location:) @opening = opening @attributes = attributes @closing = closing @location = location end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
116 117 118 |
# File 'lib/syntax_tree/xml/nodes.rb', line 116 def attributes @attributes end |
#closing ⇒ Object (readonly)
Returns the value of attribute closing.
116 117 118 |
# File 'lib/syntax_tree/xml/nodes.rb', line 116 def closing @closing end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
116 117 118 |
# File 'lib/syntax_tree/xml/nodes.rb', line 116 def location @location end |
#opening ⇒ Object (readonly)
Returns the value of attribute opening.
116 117 118 |
# File 'lib/syntax_tree/xml/nodes.rb', line 116 def opening @opening end |
Instance Method Details
#accept(visitor) ⇒ Object
125 126 127 |
# File 'lib/syntax_tree/xml/nodes.rb', line 125 def accept(visitor) visitor.visit_prolog(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
129 130 131 |
# File 'lib/syntax_tree/xml/nodes.rb', line 129 def child_nodes [opening, *attributes, closing] end |
#deconstruct_keys(keys) ⇒ Object
135 136 137 138 139 140 141 142 |
# File 'lib/syntax_tree/xml/nodes.rb', line 135 def deconstruct_keys(keys) { opening: opening, attributes: attributes, closing: closing, location: location } end |