class method
self.wrap
Ruby on Rails 7.0.10
Since v5.2.8.1Signature
self.wrap(filename)
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.
Parameters
-
filenamereq
Source
# File activestorage/app/models/active_storage/filename.rb, line 11
def wrap(filename)
filename.kind_of?(self) ? filename : new(filename)
end
Defined in activestorage/app/models/active_storage/filename.rb line 11
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Filename