Class: HttpEventStore::Actions::DeleteStream

Inherits:
Object
  • Object
show all
Defined in:
lib/http_event_store/actions/delete_stream.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ DeleteStream

Returns a new instance of DeleteStream.


5
6
7
# File 'lib/http_event_store/actions/delete_stream.rb', line 5

def initialize(client)
  @client = client
end

Instance Method Details

#call(stream_name, hard_delete) ⇒ Object


9
10
11
12
13
14
# File 'lib/http_event_store/actions/delete_stream.rb', line 9

def call(stream_name, hard_delete)
  raise IncorrectStreamData if stream_name.nil? || stream_name.empty?
  delete_stream(stream_name, hard_delete)
rescue ClientError => e
  raise StreamAlreadyDeleted
end