Sha256: 449a56b798db6a79918c2bf9a7ce0ba3a804d8ee3598a9538311b3ede614c093

Contents?: true

Size: 420 Bytes

Versions: 4

Compression:

Stored size: 420 Bytes

Contents

module NCore
  module DeleteSingle
    extend ActiveSupport::Concern

    module ClassMethods
      def delete(params={}, api_creds=nil)
        obj = new({}, api_creds)
        obj.delete(params) || raise(parent::RecordInvalid, obj)
      end
    end

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

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ncore-1.2.1 lib/ncore/methods/delete_single.rb
ncore-1.2.0 lib/ncore/methods/delete_single.rb
ncore-1.1.0 lib/ncore/methods/delete_single.rb
ncore-1.0.0 lib/ncore/methods/delete_single.rb