Class: SyntaxTree::XML::Reference
- Defined in:
- lib/syntax_tree/xml/nodes.rb
Overview
A Reference is either a character or entity reference. It contains a single value that is the token it contains.
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:) ⇒ Reference
constructor
A new instance of Reference.
Methods inherited from Node
Constructor Details
#initialize(value:, location:) ⇒ Reference
Returns a new instance of Reference.
315 316 317 318 |
# File 'lib/syntax_tree/xml/nodes.rb', line 315 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
313 314 315 |
# File 'lib/syntax_tree/xml/nodes.rb', line 313 def location @location end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
313 314 315 |
# File 'lib/syntax_tree/xml/nodes.rb', line 313 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
320 321 322 |
# File 'lib/syntax_tree/xml/nodes.rb', line 320 def accept(visitor) visitor.visit_reference(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
324 325 326 |
# File 'lib/syntax_tree/xml/nodes.rb', line 324 def child_nodes [value] end |
#deconstruct_keys(keys) ⇒ Object
330 331 332 |
# File 'lib/syntax_tree/xml/nodes.rb', line 330 def deconstruct_keys(keys) { value: value, location: location } end |