Class: RSpec::Sidekiq::NullBatch
- Inherits:
-
NullObject
- Object
- NullObject
- RSpec::Sidekiq::NullBatch
- Defined in:
- lib/rspec/sidekiq/batch.rb
Instance Attribute Summary collapse
-
#bid ⇒ Object
readonly
Returns the value of attribute bid.
-
#description ⇒ Object
Returns the value of attribute description.
Instance Method Summary collapse
-
#initialize(bid = nil) ⇒ NullBatch
constructor
A new instance of NullBatch.
- #jobs ⇒ Object
- #on(*args) ⇒ Object
- #status ⇒ Object
Methods inherited from NullObject
Constructor Details
#initialize(bid = nil) ⇒ NullBatch
Returns a new instance of NullBatch.
16 17 18 19 |
# File 'lib/rspec/sidekiq/batch.rb', line 16 def initialize(bid = nil) @bid = bid || SecureRandom.hex(8) @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.
14 15 16 |
# File 'lib/rspec/sidekiq/batch.rb', line 14 def bid @bid end |
#description ⇒ Object
Returns the value of attribute description.
13 14 15 |
# File 'lib/rspec/sidekiq/batch.rb', line 13 def description @description end |
Instance Method Details
#jobs ⇒ Object
29 30 31 |
# File 'lib/rspec/sidekiq/batch.rb', line 29 def jobs(*) yield end |
#on(*args) ⇒ Object
25 26 27 |
# File 'lib/rspec/sidekiq/batch.rb', line 25 def on(*args) @callbacks << args end |
#status ⇒ Object
21 22 23 |
# File 'lib/rspec/sidekiq/batch.rb', line 21 def status NullStatus.new(@bid, @callbacks) end |