Module: NCore::DeleteSingle

Extended by:
ActiveSupport::Concern
Defined in:
lib/ncore/methods/delete_single.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#delete(params = {}) ⇒ Object



12
13
14
15
16
17
# File 'lib/ncore/methods/delete_single.rb', line 12

def delete(params={})
  params = parse_request_params(params).reverse_merge credentials: api_creds
  parsed, @api_creds = request(:delete, resource_path, params)
  load(parsed)
  errors.empty? ? self : false
end

#delete!(params = {}) ⇒ Object



19
20
21
# File 'lib/ncore/methods/delete_single.rb', line 19

def delete!(params={})
  delete(params) || raise(self.class.module_parent::RecordInvalid, self)
end