Class: SyntaxTree::ERB::HtmlComment
- Defined in:
- lib/syntax_tree/erb/nodes.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Attributes inherited from Element
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(token:, new_line:, location:) ⇒ HtmlComment
constructor
A new instance of HtmlComment.
Methods inherited from Element
Methods inherited from Node
#format, #pretty_print, #skip?, #without_new_line
Constructor Details
#initialize(token:, new_line:, location:) ⇒ HtmlComment
Returns a new instance of HtmlComment.
555 556 557 558 |
# File 'lib/syntax_tree/erb/nodes.rb', line 555 def initialize(token:, new_line:, location:) super(new_line: new_line, location: location) @token = token end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
553 554 555 |
# File 'lib/syntax_tree/erb/nodes.rb', line 553 def token @token end |
Instance Method Details
#accept(visitor) ⇒ Object
560 561 562 |
# File 'lib/syntax_tree/erb/nodes.rb', line 560 def accept(visitor) visitor.visit_html_comment(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
564 565 566 |
# File 'lib/syntax_tree/erb/nodes.rb', line 564 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
570 571 572 |
# File 'lib/syntax_tree/erb/nodes.rb', line 570 def deconstruct_keys(keys) super.merge(token: token) end |