<commit_before>module DiabeticToolbox
  class DestroyMember
    ##
    # Construct with the id of the member to be destroyed.
    #
    # :call-seq:
    #   new(member_id) => Boolean
    #
    def initialize(member_id)
      @member_id = member_id
    end

    ##
    # Initiates the action to destroy the member.
    #
    # :call-seq:
    #   call() => DiabeticToolbox::Members::CreateMember
    #
    def call
      member = Member.find @member_id

      if member.destroy
        Result::Success.new model: member, message: I18n.t('flash.member.destroyed.success')
      else
        Result::Failure.new model: member, message: I18n.t('flash.member.destroyed.failure')
      end
    end
  end
end<commit_msg>DestroyMember now using DiabeticToolbox::Action as its base<commit_after>module DiabeticToolbox
  rely_on :action

  class DestroyMember < Action
    ##
    # Construct with the id of the member to be destroyed.
    #
    # :call-seq:
    #   new(member_id) => Boolean
    #
    def initialize(member_id)
      super nil

      @member = Member.find member_id
    end

    ##
    # Initiates the action to destroy the member.
    #
    # :call-seq:
    #   call() => DiabeticToolbox::Members::CreateMember
    #
    def _call
      if @member.destroy
        success do |option|
          option[:subject] = @member
          option[:message] = I18n.t('flash.member.destroyed.success')
        end
      else
        failure do |option|
          option[:subject] = @member
          option[:message] = I18n.t('flash.member.destroyed.failure')
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09968652037617555, 'fraction_numerical': 0.005015673981191223, 'mean_word_length': 2.277207392197125, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4112004', 'n_tokens_mistral': 500, 'n_tokens_neox': 483, 'n_words': 122}