Instance Methods
#
dev
View on GitHub
# File tmp/rubies/ruby-master/lib/prism/node_ext.rb, line 140
def heredoc?
HeredocQuery.heredoc?(opening)
end
Returns true if this node was represented as a heredoc in the source code.
dev
View on GitHub
# File tmp/rubies/ruby-master/lib/prism/node_ext.rb, line 148
def to_interpolated
InterpolatedXStringNode.new(
source,
-1,
location,
flags,
opening_loc,
[StringNode.new(source, node_id, content_loc, 0, nil, content_loc, nil, unescaped)],
closing_loc
)
end
Occasionally it’s helpful to treat a string as if it were interpolated so that there’s a consistent interface for working with strings.