Sha256: 3a6bc05bf99e881651100fe1cd6a41cae7224ef7b818cb19190f27de2930e49d
Contents?: true
Size: 927 Bytes
Versions: 18
Compression:
Stored size: 927 Bytes
Contents
# frozen_string_literal: true module Decidim module DirectVerifications module Verification # A command to destroy an authorization. class DestroyUserAuthorization < 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
Version data entries
18 entries across 18 versions & 1 rubygems