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