instance method
Pathname#empty?
() -> bool
empty?
pathname_builtin.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/pathname_builtin.rb, line 1018
def empty?
if FileTest.directory?(@path)
Dir.empty?(@path)
else
File.empty?(@path)
end
end
Tests the file is empty.
See Dir#empty? and FileTest.empty?.