Class: Coconut::Job
Instance Attribute Summary collapse
-
#completed_at ⇒ Object
readonly
Returns the value of attribute completed_at.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#output_urls ⇒ Object
readonly
Returns the value of attribute output_urls.
-
#progress ⇒ Object
readonly
Returns the value of attribute progress.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
- .apply_settings(job) ⇒ Object
- .create(job, options = {}) ⇒ Object
- .retrieve(job_id, options = {}) ⇒ Object
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Job
constructor
A new instance of Job.
Methods inherited from API
Constructor Details
#initialize(attrs = {}) ⇒ Job
Returns a new instance of Job.
5 6 7 8 9 10 11 12 13 |
# File 'lib/coconut/job.rb', line 5 def initialize(attrs={}) @id = attrs["id"] @created_at = attrs["created_at"] @completed_at = attrs["completed_at"] @status = attrs["status"] @progress = attrs["progress"] @errors = attrs["errors"] @output_urls = attrs["output_urls"] end |
Instance Attribute Details
#completed_at ⇒ Object (readonly)
Returns the value of attribute completed_at.
3 4 5 |
# File 'lib/coconut/job.rb', line 3 def completed_at @completed_at end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/coconut/job.rb', line 3 def created_at @created_at end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/coconut/job.rb', line 3 def errors @errors end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/coconut/job.rb', line 3 def id @id end |
#output_urls ⇒ Object (readonly)
Returns the value of attribute output_urls.
3 4 5 |
# File 'lib/coconut/job.rb', line 3 def output_urls @output_urls end |
#progress ⇒ Object (readonly)
Returns the value of attribute progress.
3 4 5 |
# File 'lib/coconut/job.rb', line 3 def progress @progress end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/coconut/job.rb', line 3 def status @status end |
Class Method Details
.apply_settings(job) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/coconut/job.rb', line 28 def self.apply_settings(job) if notification = Coconut.notification job[:notification] ||= {} job[:notification].merge!(notification) end if storage = Coconut.storage job[:storage] ||= {} job[:storage].merge!(storage) end return job end |