Class: Aspera::Transfer::Result
- Inherits:
-
Object
- Object
- Aspera::Transfer::Result
show all
- Defined in:
- lib/aspera/transfer/result.rb
Overview
Typed result of a transfer operation.
Replaces the ad-hoc Array polymorphism previously returned by agents.
Agents return one of the three concrete sub-classes:
Transfer::Result::Success — all sessions completed successfully
Transfer::Result::Error — at least one session failed
Transfer::Result::Async — transfer submitted to a daemon; not yet complete
Transfer::Result::DryRun — transfer not started (option `dry_run`): final transfer spec
Defined Under Namespace
Classes: Async, DryRun, Error, Success
Class Method Summary
collapse
Class Method Details
.async(job_id:, status: 'running') ⇒ Object
87
88
89
|
# File 'lib/aspera/transfer/result.rb', line 87
def async(job_id:, status: 'running')
Async.new(job_id: job_id, status: status)
end
|
.dry_run(transfer_spec) ⇒ Object
91
92
93
|
# File 'lib/aspera/transfer/result.rb', line 91
def dry_run(transfer_spec)
DryRun.new(transfer_spec)
end
|
.error(exception) ⇒ Object
83
84
85
|
# File 'lib/aspera/transfer/result.rb', line 83
def error(exception)
Error.new(exception)
end
|
.success ⇒ Object
79
80
81
|
# File 'lib/aspera/transfer/result.rb', line 79
def success
Success.new
end
|