Class: Aerospike::Operation
- Inherits:
-
Object
- Object
- Aerospike::Operation
show all
- Defined in:
- lib/aerospike/operation.rb
Constant Summary
collapse
- READ =
1
1
- WRITE =
2
- CDT_READ =
3
- CDT_MODIFY =
4
- ADD =
5
- APPEND =
9
- PREPEND =
10
- TOUCH =
11
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(op_type, bin_name = nil, bin_value = NullValue.new) ⇒ Operation
Returns a new instance of Operation.
35
36
37
38
39
40
|
# File 'lib/aerospike/operation.rb', line 35
def initialize(op_type, bin_name=nil, bin_value=NullValue.new)
@op_type = op_type
@bin_name = bin_name
@bin_value = Value.of(bin_value)
self
end
|
Instance Attribute Details
#bin_name ⇒ Object
Returns the value of attribute bin_name.
23
24
25
|
# File 'lib/aerospike/operation.rb', line 23
def bin_name
@bin_name
end
|
#bin_value ⇒ Object
Returns the value of attribute bin_value.
23
24
25
|
# File 'lib/aerospike/operation.rb', line 23
def bin_value
@bin_value
end
|
#op_type ⇒ Object
Returns the value of attribute op_type.
23
24
25
|
# File 'lib/aerospike/operation.rb', line 23
def op_type
@op_type
end
|
Class Method Details
.add(bin) ⇒ Object
66
67
68
|
# File 'lib/aerospike/operation.rb', line 66
def self.add(bin)
Operation.new(ADD, bin.name, bin.value)
end
|
.append(bin) ⇒ Object
58
59
60
|
# File 'lib/aerospike/operation.rb', line 58
def self.append(bin)
Operation.new(APPEND, bin.name, bin.value)
end
|
.get(bin_name = nil) ⇒ Object
46
47
48
|
# File 'lib/aerospike/operation.rb', line 46
def self.get(bin_name=nil)
Operation.new(READ, bin_name)
end
|
50
51
52
|
# File 'lib/aerospike/operation.rb', line 50
def self.(bin_name=nil)
Operation.new(, bin_name)
end
|
.prepend(bin) ⇒ Object
62
63
64
|
# File 'lib/aerospike/operation.rb', line 62
def self.prepend(bin)
Operation.new(PREPEND, bin.name, bin.value)
end
|
.put(bin) ⇒ Object
54
55
56
|
# File 'lib/aerospike/operation.rb', line 54
def self.put(bin)
Operation.new(WRITE, bin.name, bin.value)
end
|
.touch ⇒ Object
70
71
72
|
# File 'lib/aerospike/operation.rb', line 70
def self.touch
Operation.new(TOUCH)
end
|
Instance Method Details
#bin ⇒ Object
42
43
44
|
# File 'lib/aerospike/operation.rb', line 42
def bin
Aerospike::Bin.new(bin_name, bin_value) if bin_name && bin_value
end
|