Class: Prism::XStringNode

Inherits:
Node
  • Object
show all
Defined in:
lib/prism/node_ext.rb

Instance Method Summary collapse

Methods inherited from Node

#deprecated, #newline_flag!, #newline_flag?

Instance Method Details

#to_interpolatedObject

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



90
91
92
93
94
95
96
97
98
99
100
# File 'lib/prism/node_ext.rb', line 90

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