Sha256: af389191d12899a90c9ab5d514f28c48aae156c31a8e07d81abee8995795301c

Contents?: true

Size: 547 Bytes

Versions: 29

Compression:

Stored size: 547 Bytes

Contents

module NCore
  module DeleteSingle
    extend ActiveSupport::Concern

    module ClassMethods
      def delete(params={})
        obj = new
        obj.delete!(params)
      end
    end

    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

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

  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
ncore-3.12.0 lib/ncore/methods/delete_single.rb
ncore-3.11.0 lib/ncore/methods/delete_single.rb
ncore-3.10.0 lib/ncore/methods/delete_single.rb
ncore-3.9.1 lib/ncore/methods/delete_single.rb
ncore-3.9.0 lib/ncore/methods/delete_single.rb
ncore-3.8.1 lib/ncore/methods/delete_single.rb
ncore-3.8.0 lib/ncore/methods/delete_single.rb
ncore-3.7.1 lib/ncore/methods/delete_single.rb
ncore-3.7.0 lib/ncore/methods/delete_single.rb
ncore-3.6.2 lib/ncore/methods/delete_single.rb
ncore-3.6.1 lib/ncore/methods/delete_single.rb
ncore-3.6.0 lib/ncore/methods/delete_single.rb
ncore-3.5.2 lib/ncore/methods/delete_single.rb
ncore-3.5.1 lib/ncore/methods/delete_single.rb
ncore-3.5.0 lib/ncore/methods/delete_single.rb
ncore-3.4.4 lib/ncore/methods/delete_single.rb
ncore-3.4.3 lib/ncore/methods/delete_single.rb
ncore-3.4.2 lib/ncore/methods/delete_single.rb
ncore-3.4.1 lib/ncore/methods/delete_single.rb
ncore-3.4.0 lib/ncore/methods/delete_single.rb