Class: SyntaxTree::ERB::HtmlComment

Inherits:
Node
  • Object
show all
Defined in:
lib/syntax_tree/erb/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print

Constructor Details

#initialize(token:, location:) ⇒ HtmlComment

Returns a new instance of HtmlComment.



448
449
450
451
# File 'lib/syntax_tree/erb/nodes.rb', line 448

def initialize(token:, location:)
  @token = token
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



446
447
448
# File 'lib/syntax_tree/erb/nodes.rb', line 446

def location
  @location
end

#tokenObject (readonly)

Returns the value of attribute token.



446
447
448
# File 'lib/syntax_tree/erb/nodes.rb', line 446

def token
  @token
end

Instance Method Details

#accept(visitor) ⇒ Object



453
454
455
# File 'lib/syntax_tree/erb/nodes.rb', line 453

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

#child_nodesObject Also known as: deconstruct



457
458
459
# File 'lib/syntax_tree/erb/nodes.rb', line 457

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



463
464
465
# File 'lib/syntax_tree/erb/nodes.rb', line 463

def deconstruct_keys(keys)
  { token: token, location: location }
end