Sha256: 09901759270edac45e851c0ea8621be76b82ac4b5ebb68c106ba2d24d079dfe6
Contents?: true
Size: 997 Bytes
Versions: 7
Compression:
Stored size: 997 Bytes
Contents
# frozen_string_literal: true module Decidim module AccessRequests module Verification module Admin # A command to destroy an authorization. class DestroyAuthorization < Rectify::Command # Public: Initializes the command. # # authorization - The authorization object to destroy. def initialize(authorization) @authorization = authorization end # Executes the command. Broadcasts these events: # # - :ok when everything is valid. # - :invalid if the authorization couldn't be destroyed. # # Returns nothing. def call return broadcast(:invalid) unless authorization destroy_authorization broadcast(:ok) end private attr_reader :authorization def destroy_authorization authorization.destroy! end end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems