Class: SyntaxTree::XML::Element::ClosingTag
- Defined in:
- lib/syntax_tree/xml/nodes.rb
Overview
The closing tag of an element. It contains the opening character (<), the name of the element, and the closing character (>).
Instance Attribute Summary collapse
-
#closing ⇒ Object
readonly
Returns the value of attribute closing.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#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:, name:, closing:, location:) ⇒ ClosingTag
constructor
A new instance of ClosingTag.
Methods inherited from Node
Constructor Details
#initialize(opening:, name:, closing:, location:) ⇒ ClosingTag
Returns a new instance of ClosingTag.
259 260 261 262 263 264 |
# File 'lib/syntax_tree/xml/nodes.rb', line 259 def initialize(opening:, name:, closing:, location:) @opening = opening @name = name @closing = closing @location = location end |
Instance Attribute Details
#closing ⇒ Object (readonly)
Returns the value of attribute closing.
257 258 259 |
# File 'lib/syntax_tree/xml/nodes.rb', line 257 def closing @closing end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
257 258 259 |
# File 'lib/syntax_tree/xml/nodes.rb', line 257 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
257 258 259 |
# File 'lib/syntax_tree/xml/nodes.rb', line 257 def name @name end |
#opening ⇒ Object (readonly)
Returns the value of attribute opening.
257 258 259 |
# File 'lib/syntax_tree/xml/nodes.rb', line 257 def opening @opening end |
Instance Method Details
#accept(visitor) ⇒ Object
266 267 268 |
# File 'lib/syntax_tree/xml/nodes.rb', line 266 def accept(visitor) visitor.visit_closing_tag(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
270 271 272 |
# File 'lib/syntax_tree/xml/nodes.rb', line 270 def child_nodes [opening, name, closing] end |
#deconstruct_keys(keys) ⇒ Object
276 277 278 |
# File 'lib/syntax_tree/xml/nodes.rb', line 276 def deconstruct_keys(keys) { opening: opening, name: name, closing: closing, location: location } end |