class SyntaxTree::TStringContent
TStringContent
represents plain characters inside of an entity that accepts string content like a string, heredoc, command string, or regular expression.
"string"
In
the example above, TStringContent
represents the string
token contained within the string.
Attributes
- String
-
the content of the string
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 10999 def initialize(value:, location:) @value = value @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 11038 def ===(other) other.is_a?(TStringContent) && value === other.value end
Source
# File lib/syntax_tree/node.rb, line 11009 def accept(visitor) visitor.visit_tstring_content(self) end
Source
# File lib/syntax_tree/node.rb, line 11013 def child_nodes [] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 11017 def copy(value: nil, location: nil) node = TStringContent.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 11030 def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end
Source
# File lib/syntax_tree/node.rb, line 11005 def match?(pattern) value.match?(pattern) end