Class: Wurk::IterableJobQuery::State
- Inherits:
-
Struct
- Object
- Struct
- Wurk::IterableJobQuery::State
- Defined in:
- lib/wurk/iterable_job_query.rb
Overview
One job’s iteration state. ‘raw` is the `it-<jid>` HASH (String=>String); the accessors decode the wire fields (`ex`/`rt`/`c`/`cancelled`, §1.5).
Instance Attribute Summary collapse
-
#jid ⇒ Object
Returns the value of attribute jid.
-
#raw ⇒ Object
Returns the value of attribute raw.
Instance Method Summary collapse
-
#cancelled ⇒ Object
Epoch-seconds timestamp the job was cancelled at, or nil if it wasn’t.
- #cursor ⇒ Object
- #executions ⇒ Object
- #runtime ⇒ Object
Instance Attribute Details
#jid ⇒ Object
Returns the value of attribute jid
19 20 21 |
# File 'lib/wurk/iterable_job_query.rb', line 19 def jid @jid end |
#raw ⇒ Object
Returns the value of attribute raw
19 20 21 |
# File 'lib/wurk/iterable_job_query.rb', line 19 def raw @raw end |
Instance Method Details
#cancelled ⇒ Object
Epoch-seconds timestamp the job was cancelled at, or nil if it wasn’t.
25 26 27 28 |
# File 'lib/wurk/iterable_job_query.rb', line 25 def cancelled ts = raw['cancelled'] ts && !ts.to_s.empty? ? ts.to_i : nil end |
#cursor ⇒ Object
22 |
# File 'lib/wurk/iterable_job_query.rb', line 22 def cursor = raw['c'] && ::JSON.parse(raw['c']) |
#executions ⇒ Object
20 |
# File 'lib/wurk/iterable_job_query.rb', line 20 def executions = raw['ex'].to_i |
#runtime ⇒ Object
21 |
# File 'lib/wurk/iterable_job_query.rb', line 21 def runtime = raw['rt'].to_f |