Class: ObjectStorage::MigrateUploadsWorker::MigrationResult
- Inherits:
-
Object
- Object
- ObjectStorage::MigrateUploadsWorker::MigrationResult
- Defined in:
- app/workers/object_storage/migrate_uploads_worker.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#upload ⇒ Object
readonly
Returns the value of attribute upload.
Instance Method Summary collapse
-
#initialize(upload, error = nil) ⇒ MigrationResult
constructor
A new instance of MigrationResult.
- #success? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(upload, error = nil) ⇒ MigrationResult
Returns a new instance of MigrationResult.
22 23 24 25 |
# File 'app/workers/object_storage/migrate_uploads_worker.rb', line 22 def initialize(upload, error = nil) @upload = upload @error = error end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
20 21 22 |
# File 'app/workers/object_storage/migrate_uploads_worker.rb', line 20 def error @error end |
#upload ⇒ Object (readonly)
Returns the value of attribute upload.
19 20 21 |
# File 'app/workers/object_storage/migrate_uploads_worker.rb', line 19 def upload @upload end |
Instance Method Details
#success? ⇒ Boolean
27 28 29 |
# File 'app/workers/object_storage/migrate_uploads_worker.rb', line 27 def success? error.nil? end |
#to_s ⇒ Object
31 32 33 |
# File 'app/workers/object_storage/migrate_uploads_worker.rb', line 31 def to_s success? ? _("Migration successful.") : _("Error while migrating %{upload_id}: %{error_message}") % { upload_id: upload.id, error_message: error. } end |