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.
585 586 587 588 |
# File 'lib/syntax_tree/erb/nodes.rb', line 585 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.
583 584 585 |
# File 'lib/syntax_tree/erb/nodes.rb', line 583 def token @token end |
Instance Method Details
#accept(visitor) ⇒ Object
590 591 592 |
# File 'lib/syntax_tree/erb/nodes.rb', line 590 def accept(visitor) visitor.visit_html_comment(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
594 595 596 |
# File 'lib/syntax_tree/erb/nodes.rb', line 594 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
600 601 602 |
# File 'lib/syntax_tree/erb/nodes.rb', line 600 def deconstruct_keys(keys) super.merge(token: token) end |