Class: Couchbase::Eraser

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/eraser.rb

Constant Summary collapse

READ_METHODS =
%w(
  get
).map(&:to_sym)
WRITE_METHODS =
%w(
  set
  incr
).map(&:to_sym)

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Eraser

Returns a new instance of Eraser.



14
15
16
17
# File 'lib/couchbase/eraser.rb', line 14

def initialize(client)
  @client = client
  reset_keys!
end

Instance Method Details

#erase_written_keysObject



19
20
21
22
23
24
# File 'lib/couchbase/eraser.rb', line 19

def erase_written_keys
  @keys.each do |key|
    client.delete key, :quiet => true
  end
  reset_keys!
end