Class: Shingoncoder::Job
- Inherits:
-
Object
- Object
- Shingoncoder::Job
- Defined in:
- lib/shingoncoder/job.rb
Class Method Summary collapse
- .cancel ⇒ Object
- .create(options = {}) ⇒ Object
- .details ⇒ Object
-
.progress(id) ⇒ Object
Each output should have current_event job itself should have ‘progress’.
Class Method Details
.cancel ⇒ Object
12 13 14 |
# File 'lib/shingoncoder/job.rb', line 12 def cancel fail NotImplementedError end |
.create(options = {}) ⇒ Object
6 7 8 9 10 |
# File 'lib/shingoncoder/job.rb', line 6 def create( = {}) id = Backend::Job.create() # TODO in the future the backend could be via a HTTP API Response.new('id' => id, 'code' => 201) end |
.details ⇒ Object
26 27 28 29 |
# File 'lib/shingoncoder/job.rb', line 26 def details job = Shingoncoder::Backend::JobRegistry::Job.find(id) Response.new('body' => { 'job' => { 'input_media_file' => { 'url' => job.input.fetch('input') } } }, 'code' => 200) end |
.progress(id) ⇒ Object
Each output should have current_event job itself should have ‘progress’
18 19 20 21 |
# File 'lib/shingoncoder/job.rb', line 18 def progress(id) job = Shingoncoder::Backend::JobRegistry::Job.find(id) Response.new('body' => id, 'code' => 200) end |