Module: NCore::Delete

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

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#delete(params = {}) ⇒ Object



23
24
25
26
27
28
# File 'lib/ncore/methods/delete.rb', line 23

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



30
31
32
# File 'lib/ncore/methods/delete.rb', line 30

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