Class: RSpec::Sidekiq::NullStatus
- Inherits:
-
NullObject
- Object
- NullObject
- RSpec::Sidekiq::NullStatus
- Defined in:
- lib/rspec/sidekiq/batch.rb
Instance Attribute Summary collapse
-
#bid ⇒ Object
readonly
Returns the value of attribute bid.
Instance Method Summary collapse
- #failures ⇒ Object
-
#initialize(bid = SecureRandom.hex(8), callbacks = []) ⇒ NullStatus
constructor
A new instance of NullStatus.
- #join ⇒ Object
- #total ⇒ Object
Methods inherited from NullObject
Constructor Details
#initialize(bid = SecureRandom.hex(8), callbacks = []) ⇒ NullStatus
Returns a new instance of NullStatus.
55 56 57 58 |
# File 'lib/rspec/sidekiq/batch.rb', line 55 def initialize(bid = SecureRandom.hex(8), callbacks = []) @bid = bid @callbacks = callbacks end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RSpec::Sidekiq::NullObject
Instance Attribute Details
#bid ⇒ Object (readonly)
Returns the value of attribute bid.
53 54 55 |
# File 'lib/rspec/sidekiq/batch.rb', line 53 def bid @bid end |
Instance Method Details
#failures ⇒ Object
60 61 62 |
# File 'lib/rspec/sidekiq/batch.rb', line 60 def failures 0 end |
#join ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/rspec/sidekiq/batch.rb', line 64 def join ::Sidekiq::Worker.drain_all @callbacks.each do |event, callback, | if event != :success || failures == 0 case callback when Class callback.new.send("on_#{event}", self, ) when String klass, meth = callback.split('#') klass.constantize.new.send(meth, self, ) else raise ArgumentError, 'Unsupported callback notation' end end end end |