instance method
Pathname#absolute?
() -> bool
absolute?
pathname_builtin.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/pathname_builtin.rb, line 542
def absolute?
ABSOLUTE_PATH.match? @path
end
Predicate method for testing whether a path is absolute.
It returns true if the pathname begins with a slash.
Example
p = Pathname.new('/im/sure') p.absolute? #=> true p = Pathname.new('not/so/sure') p.absolute? #=> false