instance method
Prism::DefNode#===
===(other)
lib/prism/node.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/node.rb, line 6189
def ===(other)
other.is_a?(DefNode) &&
(name === other.name) &&
(name_loc.nil? == other.name_loc.nil?) &&
(receiver === other.receiver) &&
(parameters === other.parameters) &&
(body === other.body) &&
(locals.length == other.locals.length) &&
locals.zip(other.locals).all? { |left, right| left === right } &&
(def_keyword_loc.nil? == other.def_keyword_loc.nil?) &&
(operator_loc.nil? == other.operator_loc.nil?) &&
(lparen_loc.nil? == other.lparen_loc.nil?) &&
(rparen_loc.nil? == other.rparen_loc.nil?) &&
(equal_loc.nil? == other.equal_loc.nil?) &&
(end_keyword_loc.nil? == other.end_keyword_loc.nil?)
end
Implements case-equality for the node. This is effectively == but without comparing the value of locations. Locations are checked only for presence.