Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Pathname#symlink?
() -> untyped
symlink? → true or false
pathname_builtin.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/pathname_builtin.rb, line 2686
def symlink?() FileTest.symlink?(@path) end
Returns whether the entry at the path in self is a symbolic link:
Example
file_pn = Pathname('/etc/passwd') link_pn = Pathname('/tmp/foo') link_pn.make_symlink(file_pn) file_pn.symlink? # => false link_pn.symlink? # => true link_pn.delete # Clean up.