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.
608 609 610 611 |
# File 'lib/syntax_tree/erb/nodes.rb', line 608 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.
606 607 608 |
# File 'lib/syntax_tree/erb/nodes.rb', line 606 def token @token end |
Instance Method Details
#accept(visitor) ⇒ Object
613 614 615 |
# File 'lib/syntax_tree/erb/nodes.rb', line 613 def accept(visitor) visitor.visit_erb_comment(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
617 618 619 |
# File 'lib/syntax_tree/erb/nodes.rb', line 617 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
623 624 625 |
# File 'lib/syntax_tree/erb/nodes.rb', line 623 def deconstruct_keys(keys) super.merge(token: token) end |