instance method
extension_with_delimiter
Ruby on Rails 7.0.10
Since v5.2.8.1Signature
extension_with_delimiter()
Returns the extension of the filename (i.e. the substring following the last dot, excluding a dot at the beginning) with the dot that precedes it. If the filename has no extension, an empty string is returned.
ActiveStorage::Filename.new("racecar.jpg").extension_with_delimiter # => ".jpg" ActiveStorage::Filename.new("racecar").extension_with_delimiter # => "" ActiveStorage::Filename.new(".gitignore").extension_with_delimiter # => ""
Source
# File activestorage/app/models/active_storage/filename.rb, line 35
def extension_with_delimiter
File.extname @filename
end
Defined in activestorage/app/models/active_storage/filename.rb line 35
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Filename