class SyntaxTree::HeredocBeg
HeredocBeg
represents the beginning declaration of a heredoc.
<<~DOC contents DOC
In
the example above the HeredocBeg
node represents <<~DOC.
Attributes
- String
-
the opening declaration of the heredoc
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 5908 def initialize(value:, location:) @value = value @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 5943 def ===(other) other.is_a?(HeredocBeg) && value === other.value end
Source
# File lib/syntax_tree/node.rb, line 5914 def accept(visitor) visitor.visit_heredoc_beg(self) end
Source
# File lib/syntax_tree/node.rb, line 5918 def child_nodes [] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 5922 def copy(value: nil, location: nil) node = HeredocBeg.new( value: value || self.value, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
Source
# File lib/syntax_tree/node.rb, line 5935 def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end