Method: ActiveStorage::Filename#base
- Defined in:
- activestorage/app/models/active_storage/filename.rb
#base ⇒ Object
Returns the part of the filename preceding any extension.
ActiveStorage::Filename.new("racecar.jpg").base # => "racecar"
ActiveStorage::Filename.new("racecar").base # => "racecar"
ActiveStorage::Filename.new(".gitignore").base # => ".gitignore"
27 28 29 |
# File 'activestorage/app/models/active_storage/filename.rb', line 27 def base File.basename @filename, extension_with_delimiter end |