Class: SSDB::Batch
- Inherits:
-
Array
- Object
- Array
- SSDB::Batch
- Defined in:
- lib/ssdb/batch.rb
Instance Method Summary collapse
-
#call(opts) ⇒ Object
Call command.
-
#initialize ⇒ Batch
constructor
Constructor.
- #values=(values) ⇒ Object
Constructor Details
#initialize ⇒ Batch
Constructor
4 5 6 7 |
# File 'lib/ssdb/batch.rb', line 4 def initialize @futures = [] super end |
Instance Method Details
#call(opts) ⇒ Object
Call command
11 12 13 14 15 16 17 |
# File 'lib/ssdb/batch.rb', line 11 def call(opts) push(opts) future = SSDB::Future.new(opts[:cmd]) @futures.push(future) future end |
#values=(values) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/ssdb/batch.rb', line 20 def values=(values) values.each_with_index do |value, index| future = @futures[index] future.value = value if future end end |