module Photish::Gallery::Traits::Fileable

Public Instance Methods

basename() click to toggle source
# File lib/photish/gallery/traits/fileable.rb, line 20
def basename
  File.basename(path)
end
basename_without_extension() click to toggle source
# File lib/photish/gallery/traits/fileable.rb, line 24
def basename_without_extension
  File.basename(path, '.*')
end
dirname() click to toggle source
# File lib/photish/gallery/traits/fileable.rb, line 16
def dirname
  File.dirname(path)
end
extension() click to toggle source
# File lib/photish/gallery/traits/fileable.rb, line 12
def extension
  extension_of(path)
end
extension_of(file) click to toggle source
# File lib/photish/gallery/traits/fileable.rb, line 5
def extension_of(file)
  File.extname(file)
      .split('.')
      .last
      .try(:downcase)
end