Class: Delayed::Batch::PerformableBatch
- Inherits:
-
Struct
- Object
- Struct
- Delayed::Batch::PerformableBatch
- Defined in:
- lib/delayed/batch.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
Returns the value of attribute items.
-
#mode ⇒ Object
Returns the value of attribute mode.
Instance Method Summary collapse
- #display_name ⇒ Object (also: #tag, #full_name)
-
#initialize(mode, items) ⇒ PerformableBatch
constructor
A new instance of PerformableBatch.
- #jobs ⇒ Object
- #perform ⇒ Object
Constructor Details
#initialize(mode, items) ⇒ PerformableBatch
Returns a new instance of PerformableBatch.
6 7 8 9 10 |
# File 'lib/delayed/batch.rb', line 6 def initialize(mode, items) raise "unsupported mode" unless mode == :serial super end |
Instance Attribute Details
#items ⇒ Object
Returns the value of attribute items
5 6 7 |
# File 'lib/delayed/batch.rb', line 5 def items @items end |
#mode ⇒ Object
Returns the value of attribute mode
5 6 7 |
# File 'lib/delayed/batch.rb', line 5 def mode @mode end |
Instance Method Details
#display_name ⇒ Object Also known as: tag, full_name
12 13 14 |
# File 'lib/delayed/batch.rb', line 12 def display_name "Delayed::Batch.#{mode}" end |
#jobs ⇒ Object
22 23 24 |
# File 'lib/delayed/batch.rb', line 22 def jobs items.map { |opts| Delayed::Job.new(**opts) } end |
#perform ⇒ Object
18 19 20 |
# File 'lib/delayed/batch.rb', line 18 def perform raise "can't perform a batch directly" end |