Class: Aerospike::BatchItem
- Inherits:
-
Object
- Object
- Aerospike::BatchItem
- Defined in:
- lib/aerospike/command/batch_item.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#indexes ⇒ Object
Returns the value of attribute indexes.
-
#key ⇒ Object
Returns the value of attribute key.
Class Method Summary collapse
Instance Method Summary collapse
- #index ⇒ Object
-
#initialize(key, indexes) ⇒ BatchItem
constructor
A new instance of BatchItem.
Constructor Details
permalink #initialize(key, indexes) ⇒ BatchItem
Returns a new instance of BatchItem.
34 35 36 37 |
# File 'lib/aerospike/command/batch_item.rb', line 34 def initialize(key, indexes) @key = key @indexes = indexes end |
Instance Attribute Details
permalink #indexes ⇒ Object
Returns the value of attribute indexes.
23 24 25 |
# File 'lib/aerospike/command/batch_item.rb', line 23 def indexes @indexes end |
permalink #key ⇒ Object
Returns the value of attribute key.
22 23 24 |
# File 'lib/aerospike/command/batch_item.rb', line 22 def key @key end |
Class Method Details
permalink .generate_map(keys) ⇒ Object
[View source]
25 26 27 28 29 30 31 32 |
# File 'lib/aerospike/command/batch_item.rb', line 25 def self.generate_map(keys) map = keys.each_with_index .group_by { |key, _| key } .map { |key, keys_with_idx| [key.digest, BatchItem.new(key, keys_with_idx.map(&:last))] } map.to_h end |
Instance Method Details
permalink #index ⇒ Object
[View source]
39 40 41 |
# File 'lib/aerospike/command/batch_item.rb', line 39 def index indexes.shift end |