Class: GOM::Storage::Remover

Inherits:
Object
  • Object
show all
Defined in:
lib/gom/storage/remover.rb

Overview

Removes an object from the storage.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object_or_id) ⇒ Remover

Returns a new instance of Remover.



8
9
10
11
12
# File 'lib/gom/storage/remover.rb', line 8

def initialize(object_or_id)
  @object, @id = object_or_id.is_a?(GOM::Object::Id) ?
    [ nil, object_or_id ] :
    [ object_or_id, nil ]
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/gom/storage/remover.rb', line 6

def id
  @id
end

#objectObject (readonly)

Returns the value of attribute object.



5
6
7
# File 'lib/gom/storage/remover.rb', line 5

def object
  @object
end

Instance Method Details

#performObject



14
15
16
17
18
# File 'lib/gom/storage/remover.rb', line 14

def perform
  check_mapping
  remove_object
  remove_mapping
end