class Shoryuken::Batch::Status
Attributes
bid[R]
Public Class Methods
new(bid)
click to toggle source
# File lib/shoryuken/batch/status.rb, line 6 def initialize(bid) @bid = bid end
Public Instance Methods
child_count()
click to toggle source
# File lib/shoryuken/batch/status.rb, line 46 def child_count Shoryuken.redis { |r| r.hget("BID-#{bid}", 'children') }.to_i end
complete?()
click to toggle source
# File lib/shoryuken/batch/status.rb, line 42 def complete? Shoryuken.redis { |r| r.hget("BID-#{bid}", 'complete') } == 'true' end
created_at()
click to toggle source
# File lib/shoryuken/batch/status.rb, line 26 def created_at Shoryuken.redis { |r| r.hget("BID-#{bid}", 'created_at') } end
data()
click to toggle source
# File lib/shoryuken/batch/status.rb, line 50 def data { total: total, failures: failures, pending: pending, created_at: created_at, complete: complete?, failure_info: failure_info, parent_bid: parent_bid } end
description()
click to toggle source
# File lib/shoryuken/batch/status.rb, line 14 def description Shoryuken.redis { |r| r.hget("BID-#{bid}", 'description') } end
failure_info()
click to toggle source
# File lib/shoryuken/batch/status.rb, line 38 def failure_info Shoryuken.redis { |r| r.smembers("BID-#{bid}-failed") } || [] end
failures()
click to toggle source
# File lib/shoryuken/batch/status.rb, line 22 def failures Shoryuken.redis { |r| r.scard("BID-#{bid}-failed") }.to_i end
join()
click to toggle source
# File lib/shoryuken/batch/status.rb, line 10 def join raise 'Not supported' end
parent_bid()
click to toggle source
# File lib/shoryuken/batch/status.rb, line 34 def parent_bid Shoryuken.redis { |r| r.hget("BID-#{bid}", 'parent_bid') } end
pending()
click to toggle source
# File lib/shoryuken/batch/status.rb, line 18 def pending Shoryuken.redis { |r| r.hget("BID-#{bid}", 'pending') }.to_i end
total()
click to toggle source
# File lib/shoryuken/batch/status.rb, line 30 def total Shoryuken.redis { |r| r.hget("BID-#{bid}", 'total') }.to_i end