Class: SyntaxTree::ERB::HtmlNode::ClosingTag
- Defined in:
- lib/syntax_tree/erb/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.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#opening ⇒ Object
readonly
Returns the value of attribute opening.
Attributes inherited from Element
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(opening:, name:, closing:, location:, new_line:) ⇒ ClosingTag
constructor
A new instance of ClosingTag.
Methods inherited from Element
Methods inherited from Node
#format, #pretty_print, #skip?, #without_new_line
Constructor Details
#initialize(opening:, name:, closing:, location:, new_line:) ⇒ ClosingTag
Returns a new instance of ClosingTag.
215 216 217 218 219 220 |
# File 'lib/syntax_tree/erb/nodes.rb', line 215 def initialize(opening:, name:, closing:, location:, new_line:) super(new_line: new_line, location: location) @opening = opening @name = name @closing = closing end |
Instance Attribute Details
#closing ⇒ Object (readonly)
Returns the value of attribute closing.
213 214 215 |
# File 'lib/syntax_tree/erb/nodes.rb', line 213 def closing @closing end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
213 214 215 |
# File 'lib/syntax_tree/erb/nodes.rb', line 213 def name @name end |
#opening ⇒ Object (readonly)
Returns the value of attribute opening.
213 214 215 |
# File 'lib/syntax_tree/erb/nodes.rb', line 213 def opening @opening end |
Instance Method Details
#accept(visitor) ⇒ Object
222 223 224 |
# File 'lib/syntax_tree/erb/nodes.rb', line 222 def accept(visitor) visitor.visit_closing_tag(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
226 227 228 |
# File 'lib/syntax_tree/erb/nodes.rb', line 226 def child_nodes [opening, name, closing] end |
#deconstruct_keys(keys) ⇒ Object
232 233 234 |
# File 'lib/syntax_tree/erb/nodes.rb', line 232 def deconstruct_keys(keys) super.merge(opening: opening, name: name, closing: closing) end |