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.



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

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