Is it possible to get the file name from a Fileclass object ?
For example, this method works well:
file = File::basename('/home/user/file.rb')
p file
but for the object it does not work
file = File.new('/home/user/file.rb')
p file.basename
user792923
source
share