Sha256: e2cd4a6c4878ec9dd07ae46b429f723d3122af4889aff01ed5dd9826328dffc8

Contents?: true

Size: 385 Bytes

Versions: 12

Compression:

Stored size: 385 Bytes

Contents

# frozen_string_literal: true

require 'active_support'

class DHS::Record

  module Destroy
    extend ActiveSupport::Concern

    module ClassMethods
      def destroy(args, options = nil)
        options = {} if options.blank?
        params = args.respond_to?(:to_h) ? args : { id: args }
        request(options.merge(params: params, method: :delete))
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dhs-1.6.0 lib/dhs/concerns/record/destroy.rb
dhs-1.5.0 lib/dhs/concerns/record/destroy.rb
dhs-1.4.2 lib/dhs/concerns/record/destroy.rb
dhs-1.4.1 lib/dhs/concerns/record/destroy.rb
dhs-1.4.0 lib/dhs/concerns/record/destroy.rb
dhs-1.3.0 lib/dhs/concerns/record/destroy.rb
dhs-1.2.0 lib/dhs/concerns/record/destroy.rb
dhs-1.1.0 lib/dhs/concerns/record/destroy.rb
dhs-1.0.3 lib/dhs/concerns/record/destroy.rb
dhs-1.0.2 lib/dhs/concerns/record/destroy.rb
dhs-1.0.1 lib/dhs/concerns/record/destroy.rb
dhs-1.0.0 lib/dhs/concerns/record/destroy.rb