Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Pathname#==
(untyped) -> bool
self == other → true or false
pathname_builtin.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/pathname_builtin.rb, line 415
def ==(other)
return false unless Pathname === other
other.path == @path
end
Returns whether the stored paths in self and other are equal:
Example
pn = Pathname('lib') pn == Pathname('lib') # => true pn == Pathname('./lib') # => false
Returns false if other is not a pathname:
Example
pn == 'lib' # => false