Class: Arpa::Repositories::Profiles::Remover

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/arpa/repositories/profiles/remover.rb

Instance Method Summary collapse

Instance Method Details

#destroy(entity) ⇒ Object



7
8
9
# File 'lib/arpa/repositories/profiles/remover.rb', line 7

def destroy(entity)
  repository_class.destroy(entity.id)
end

#disable(entity) ⇒ Object



11
12
13
14
15
16
# File 'lib/arpa/repositories/profiles/remover.rb', line 11

def disable(entity)
  record = mapper_instance.map_to_record(entity)
  repository_class.update(record.id, removed: true)
  record.reload
  mapper_instance.map_to_entity(record)
end

#mapper_instanceObject



18
19
20
# File 'lib/arpa/repositories/profiles/remover.rb', line 18

def mapper_instance
  Arpa::DataMappers::ProfileMapper.instance
end

#repository_classObject



22
23
24
# File 'lib/arpa/repositories/profiles/remover.rb', line 22

def repository_class
  RepositoryProfile
end