Class: Arcp::Job::Cancel
- Inherits:
-
Data
- Object
- Data
- Arcp::Job::Cancel
- Defined in:
- lib/arcp/job/cancel.rb
Instance Attribute Summary collapse
-
#job_id ⇒ Object
readonly
Returns the value of attribute job_id.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#job_id ⇒ Object (readonly)
Returns the value of attribute job_id
5 6 7 |
# File 'lib/arcp/job/cancel.rb', line 5 def job_id @job_id end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason
5 6 7 |
# File 'lib/arcp/job/cancel.rb', line 5 def reason @reason end |
Class Method Details
.from_h(h) ⇒ Object
6 7 8 9 |
# File 'lib/arcp/job/cancel.rb', line 6 def self.from_h(h) h = h.transform_keys(&:to_s) new(job_id: h.fetch('job_id'), reason: h['reason']) end |
Instance Method Details
#to_h ⇒ Object
11 12 13 14 15 |
# File 'lib/arcp/job/cancel.rb', line 11 def to_h out = { 'job_id' => job_id } out['reason'] = reason if reason out end |