Method: ActiveStorage::Filename.wrap
- Defined in:
- activestorage/app/models/active_storage/filename.rb
.wrap(filename) ⇒ Object
Returns a Filename instance based on the given filename. If the filename is a Filename, it is returned unmodified. If it is a String, it is passed to ActiveStorage::Filename.new.
13 14 15 |
# File 'activestorage/app/models/active_storage/filename.rb', line 13 def wrap(filename) filename.kind_of?(self) ? filename : new(filename) end |