Class: Rafflesia::JobQueueData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::JobQueueData
- Defined in:
- lib/rafflesia/jobs/job_queue_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ active: :active, pending: :pending, queue: :queue, retry: :retry, scheduled: :scheduled }.freeze
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#pending ⇒ Object
Returns the value of attribute pending.
-
#queue ⇒ Object
Returns the value of attribute queue.
-
#retry ⇒ Object
Returns the value of attribute retry.
-
#scheduled ⇒ Object
Returns the value of attribute scheduled.
Instance Method Summary collapse
-
#initialize(json) ⇒ JobQueueData
constructor
A new instance of JobQueueData.
Constructor Details
#initialize(json) ⇒ JobQueueData
Returns a new instance of JobQueueData.
23 24 25 26 27 28 29 30 31 |
# File 'lib/rafflesia/jobs/job_queue_data.rb', line 23 def initialize(json) super() hash = self.class.normalize(json) @active = (hash[:active] || []).map { |item| item ? Rafflesia::JobQueueTask.new(item) : nil } @pending = (hash[:pending] || []).map { |item| item ? Rafflesia::JobQueueTask.new(item) : nil } @queue = hash[:queue] ? Rafflesia::JobQueueInfo.new(hash[:queue]) : nil @retry = (hash[:retry] || []).map { |item| item ? Rafflesia::JobQueueTask.new(item) : nil } @scheduled = (hash[:scheduled] || []).map { |item| item ? Rafflesia::JobQueueTask.new(item) : nil } end |
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
16 17 18 |
# File 'lib/rafflesia/jobs/job_queue_data.rb', line 16 def active @active end |
#pending ⇒ Object
Returns the value of attribute pending.
16 17 18 |
# File 'lib/rafflesia/jobs/job_queue_data.rb', line 16 def pending @pending end |
#queue ⇒ Object
Returns the value of attribute queue.
16 17 18 |
# File 'lib/rafflesia/jobs/job_queue_data.rb', line 16 def queue @queue end |
#retry ⇒ Object
Returns the value of attribute retry.
16 17 18 |
# File 'lib/rafflesia/jobs/job_queue_data.rb', line 16 def retry @retry end |
#scheduled ⇒ Object
Returns the value of attribute scheduled.
16 17 18 |
# File 'lib/rafflesia/jobs/job_queue_data.rb', line 16 def scheduled @scheduled end |