class Prism::StringNode

Public Instance Methods

to_interpolated ()

Occasionally it’s helpful to treat a string as if it were interpolated so that there’s a consistent interface for working with strings.

# File lib/prism/node_ext.rb, line 72
def to_interpolated
  InterpolatedStringNode.new(
    source,
    -1,
    location,
    frozen? ? InterpolatedStringNodeFlags::FROZEN : 0,
    opening_loc,
    [copy(location: content_loc, opening_loc: nil, closing_loc: nil)],
    closing_loc
  )
end