Class: SyntaxTree::ERB::HtmlComment

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:) ⇒ HtmlComment

Returns a new instance of HtmlComment.



555
556
557
558
# File 'lib/syntax_tree/erb/nodes.rb', line 555

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.



553
554
555
# File 'lib/syntax_tree/erb/nodes.rb', line 553

def token
  @token
end

Instance Method Details

#accept(visitor) ⇒ Object



560
561
562
# File 'lib/syntax_tree/erb/nodes.rb', line 560

def accept(visitor)
  visitor.visit_html_comment(self)
end

#child_nodesObject Also known as: deconstruct



564
565
566
# File 'lib/syntax_tree/erb/nodes.rb', line 564

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



570
571
572
# File 'lib/syntax_tree/erb/nodes.rb', line 570

def deconstruct_keys(keys)
  super.merge(token: token)
end