Class: Arcp::Job::Result
- Inherits:
-
Data
- Object
- Data
- Arcp::Job::Result
- Defined in:
- lib/arcp/job/result.rb
Instance Attribute Summary collapse
-
#completed_at ⇒ Object
readonly
Returns the value of attribute completed_at.
-
#final_status ⇒ Object
readonly
Returns the value of attribute final_status.
-
#job_id ⇒ Object
readonly
Returns the value of attribute job_id.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#result_id ⇒ Object
readonly
Returns the value of attribute result_id.
-
#result_size ⇒ Object
readonly
Returns the value of attribute result_size.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#completed_at ⇒ Object (readonly)
Returns the value of attribute completed_at
5 6 7 |
# File 'lib/arcp/job/result.rb', line 5 def completed_at @completed_at end |
#final_status ⇒ Object (readonly)
Returns the value of attribute final_status
5 6 7 |
# File 'lib/arcp/job/result.rb', line 5 def final_status @final_status end |
#job_id ⇒ Object (readonly)
Returns the value of attribute job_id
5 6 7 |
# File 'lib/arcp/job/result.rb', line 5 def job_id @job_id end |
#result ⇒ Object (readonly)
Returns the value of attribute result
5 6 7 |
# File 'lib/arcp/job/result.rb', line 5 def result @result end |
#result_id ⇒ Object (readonly)
Returns the value of attribute result_id
5 6 7 |
# File 'lib/arcp/job/result.rb', line 5 def result_id @result_id end |
#result_size ⇒ Object (readonly)
Returns the value of attribute result_size
5 6 7 |
# File 'lib/arcp/job/result.rb', line 5 def result_size @result_size end |
Class Method Details
.from_h(h) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/arcp/job/result.rb', line 6 def self.from_h(h) h = h.transform_keys(&:to_s) new( job_id: h.fetch('job_id'), final_status: h.fetch('final_status'), result: h['result'], result_id: h['result_id'], result_size: h['result_size'], completed_at: h['completed_at'] ) end |
Instance Method Details
#chunked? ⇒ Boolean
27 |
# File 'lib/arcp/job/result.rb', line 27 def chunked? = !result_id.nil? |
#to_h ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/arcp/job/result.rb', line 18 def to_h out = { 'job_id' => job_id, 'final_status' => final_status } out['result'] = result if result out['result_id'] = result_id if result_id out['result_size'] = result_size if result_size out['completed_at'] = completed_at if completed_at out end |