Class: Arcp::Job::EventBody::Progress
- Inherits:
-
Data
- Object
- Data
- Arcp::Job::EventBody::Progress
- Defined in:
- lib/arcp/job/event_body/progress.rb
Instance Attribute Summary collapse
-
#current ⇒ Object
readonly
Returns the value of attribute current.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
-
#units ⇒ Object
readonly
Returns the value of attribute units.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current
6 7 8 |
# File 'lib/arcp/job/event_body/progress.rb', line 6 def current @current end |
#message ⇒ Object (readonly)
Returns the value of attribute message
6 7 8 |
# File 'lib/arcp/job/event_body/progress.rb', line 6 def @message end |
#total ⇒ Object (readonly)
Returns the value of attribute total
6 7 8 |
# File 'lib/arcp/job/event_body/progress.rb', line 6 def total @total end |
#units ⇒ Object (readonly)
Returns the value of attribute units
6 7 8 |
# File 'lib/arcp/job/event_body/progress.rb', line 6 def units @units end |
Class Method Details
.from_h(h) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/arcp/job/event_body/progress.rb', line 7 def self.from_h(h) h = h.transform_keys(&:to_s) new( current: h.fetch('current'), total: h['total'], units: h['units'], message: h['message'] ) end |
Instance Method Details
#to_h ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/arcp/job/event_body/progress.rb', line 17 def to_h out = { 'current' => current } out['total'] = total if total out['units'] = units if units out['message'] = if out end |