Class: SyntaxTree::XML::Misc
Overview
A Misc is a catch-all for miscellaneous content outside the root tag of the XML document. It contains a single token which can be either a comment, a processing instruction, or whitespace.
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(value:, location:) ⇒ Misc
constructor
A new instance of Misc.
Methods inherited from Node
Constructor Details
#initialize(value:, location:) ⇒ Misc
Returns a new instance of Misc.
393 394 395 396 |
# File 'lib/syntax_tree/xml/nodes.rb', line 393 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
391 392 393 |
# File 'lib/syntax_tree/xml/nodes.rb', line 391 def location @location end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
391 392 393 |
# File 'lib/syntax_tree/xml/nodes.rb', line 391 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
398 399 400 |
# File 'lib/syntax_tree/xml/nodes.rb', line 398 def accept(visitor) visitor.visit_misc(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
402 403 404 |
# File 'lib/syntax_tree/xml/nodes.rb', line 402 def child_nodes [value] end |
#deconstruct_keys(keys) ⇒ Object
408 409 410 |
# File 'lib/syntax_tree/xml/nodes.rb', line 408 def deconstruct_keys(keys) { value: value, location: location } end |