Class: SyntaxTree::ERB::ErbComment
- 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:) ⇒ ErbComment
constructor
A new instance of ErbComment.
Methods inherited from Element
Methods inherited from Node
#format, #pretty_print, #skip?, #without_new_line
Constructor Details
#initialize(token:, new_line:, location:) ⇒ ErbComment
Returns a new instance of ErbComment.
578 579 580 581 |
# File 'lib/syntax_tree/erb/nodes.rb', line 578 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.
576 577 578 |
# File 'lib/syntax_tree/erb/nodes.rb', line 576 def token @token end |
Instance Method Details
#accept(visitor) ⇒ Object
583 584 585 |
# File 'lib/syntax_tree/erb/nodes.rb', line 583 def accept(visitor) visitor.visit_erb_comment(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
587 588 589 |
# File 'lib/syntax_tree/erb/nodes.rb', line 587 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
593 594 595 |
# File 'lib/syntax_tree/erb/nodes.rb', line 593 def deconstruct_keys(keys) super.merge(token: token) end |