Method: Prism::InterpolatedStringNode#===

Defined in:
lib/prism/node.rb

#===(other) ⇒ Object

Implements case-equality for the node. This is effectively == but without comparing the value of locations. Locations are checked only for presence.


10943
10944
10945
10946
10947
10948
10949
10950
# File 'lib/prism/node.rb', line 10943

def ===(other)
  other.is_a?(InterpolatedStringNode) &&
    (flags === other.flags) &&
    (opening_loc.nil? == other.opening_loc.nil?) &&
    (parts.length == other.parts.length) &&
    parts.zip(other.parts).all? { |left, right| left === right } &&
    (closing_loc.nil? == other.closing_loc.nil?)
end