Module: BlockScore::Actions::Delete

Extended by:
Forwardable
Included in:
Candidate
Defined in:
lib/blockscore/actions/delete.rb

Overview

Provides a :delete instance method to including classes.

Returns the updated object with deleted == true.

Examples

candidate.delete

> #<BlockScore::Candidate:0x007fe39c424410>

Instance Method Summary collapse

Instance Method Details

#deleteObject



18
19
20
21
22
# File 'lib/blockscore/actions/delete.rb', line 18

def delete
  delete!
rescue Error
  false
end

#delete!Object



24
25
26
27
28
# File 'lib/blockscore/actions/delete.rb', line 24

def delete!
  self.class.delete("#{endpoint}/#{id}", {})
  attributes[:deleted] = true
  true
end