Class: SyntaxTree::ERB::ErbComment

Inherits:
Element show all
Defined in:
lib/syntax_tree/erb/nodes.rb

Instance Attribute Summary collapse

Attributes inherited from Element

#location, #new_line

Instance Method Summary collapse

Methods inherited from Element

#without_new_line

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

#tokenObject (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_nodesObject 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