Sha256: 66ae7516b44ebdef53b79c5a0c884bb8fe713f1e4dea2c1d6c53acf8e8a5d1b2

Contents?: true

Size: 427 Bytes

Versions: 23

Compression:

Stored size: 427 Bytes

Contents

# frozen_string_literal: true

module Azeroth
  class RequestHandler
    # @api private
    #
    # hadler for requests to destroy resources
    class Destroy < RequestHandler
      private

      # @private
      #
      # Destroy and return an instance of the model
      #
      # @return [Object]
      def resource
        resource = controller.send(model.name)
        resource.tap(&:destroy)
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
azeroth-0.3.0 lib/azeroth/request_handler/destroy.rb
azeroth-0.2.0 lib/azeroth/request_handler/destroy.rb
azeroth-0.1.0 lib/azeroth/request_handler/destroy.rb