Module: Shared::Deletable

Overview

The Deletable mixin provides classes with support for deletion. The class must provide two instance variables: client and location

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#collectionObject



24
25
26
# File 'lib/vas/shared/deletable.rb', line 24

def collection
  @collection
end

Instance Method Details

#deleteObject

Performs a delete. If a collection is available it is reloaded



27
28
29
30
# File 'lib/vas/shared/deletable.rb', line 27

def delete
  @client.delete(@location)
  @collection.reload unless @collection.nil?
end