rails
https://github.com/rails/rails
Ruby
Ruby on Rails
ActiveStorage::Blob#representation
Returns an ActiveStorage::Preview instance for a previewable blob or an ActiveStorage::Variant instance for an image blob. blob.representation(resize: "100x100").processed.service_url Raises ActiveStorage::Blob::UnrepresentableError if the receiving blob is neither an image nor previewable. Call ActiveStorage::Blob#representable? to determine whether a blob is representable. See ActiveStorage::Blob#preview and ActiveStorage::Blob#variant for more information.
Edit
git clone [email protected]:rails/rails.git
cd rails
open activestorage/app/models/active_storage/blob.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-ActiveStorage--Blob-representation-for-pr
# Commit to gitgit add activestorage/app/models/active_storage/blob.rbgit commit -m "better docs for ActiveStorage::Blob#representation"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-ActiveStorage--Blob-representation-for-pr
hub pull-request
# Celebrate!