Class: Textus::Handlers::Write::DeleteKey

Inherits:
Object
  • Object
show all
Defined in:
lib/textus/handlers/write/delete_key.rb

Instance Method Summary collapse

Constructor Details

#initialize(container:) ⇒ DeleteKey

Returns a new instance of DeleteKey.



5
6
7
# File 'lib/textus/handlers/write/delete_key.rb', line 5

def initialize(container:)
  @container = container
end

Instance Method Details

#call(command, call) ⇒ Object



9
10
11
12
13
# File 'lib/textus/handlers/write/delete_key.rb', line 9

def call(command, call)
  writer = Store::Entry::Writer.from(container: @container, call: call)
  writer.delete(command.key, if_etag: command.if_etag)
  Value::Result.success("protocol" => Textus::PROTOCOL, "ok" => true, "key" => command.key, "deleted" => true)
end