Class: Riak::Crdt::Set::BatchSet
Instance Method Summary
collapse
#add, #context?, #empty?, #include?, #to_a
Constructor Details
#initialize(base) ⇒ BatchSet
Returns a new instance of BatchSet.
97
98
99
100
|
# File 'lib/riak/crdt/set.rb', line 97
def initialize(base)
super(base)
@removes = ::Set.new
end
|
Instance Method Details
#members ⇒ Object
Also known as:
value
109
110
111
|
# File 'lib/riak/crdt/set.rb', line 109
def members
(@base + @adds).subtract @removes
end
|
#operations ⇒ Object
115
116
117
118
119
120
|
# File 'lib/riak/crdt/set.rb', line 115
def operations
Operation::Update.new.tap do |op|
op.type = :set
op.value = {add: @adds.to_a, remove: @removes.to_a}
end
end
|
#remove(element) ⇒ Object
Also known as:
delete