<commit_before>module Hyrax
  module Actors
    class Environment
      # @param [ActiveFedora::Base] curation_concern work to operate on
      # @param [Ability] current_ability the authorizations of the acting user
      # @param [ActionController::Parameters] attributes user provided form attributes
      def initialize(curation_concern, current_ability, attributes)
        @curation_concern = curation_concern
        @current_ability = current_ability
        @attributes = attributes.to_h.with_indifferent_access
        @actor_storage = {}
      end

      attr_reader :curation_concern, :current_ability, :attributes

      # @return [User] the user from the current_ability
      def user
        current_ability.current_user
      end

      def store(actor, key, value)
        store_for(actor)[key] = value
      end

      def retrieve(actor, key)
        store_for(actor)[key]
      end

      private

        def store_for(actor)
          @actor_storage[actor] ||= {}
        end<commit_msg>[wings] Add `Hyrax::Actors::Environment#curation_concern=`<commit_after>module Hyrax
  module Actors
    class Environment
      # @param [ActiveFedora::Base] curation_concern work to operate on
      # @param [Ability] current_ability the authorizations of the acting user
      # @param [ActionController::Parameters] attributes user provided form attributes
      def initialize(curation_concern, current_ability, attributes)
        @curation_concern = curation_concern
        @current_ability = current_ability
        @attributes = attributes.to_h.with_indifferent_access
        @actor_storage = {}
      end

      attr_reader   :current_ability, :attributes
      attr_accessor :curation_concern

      # @return [User] the user from the current_ability
      def user
        current_ability.current_user
      end

      def store(actor, key, value)
        store_for(actor)[key] = value
      end

      def retrieve(actor, key)
        store_for(actor)[key]
      end

      private

        def store_for(actor)
          @actor_storage[actor] ||= {}
        end
{'fraction_non_alphanumeric': 0.07231800766283525, 'fraction_numerical': 0.0, 'mean_word_length': 2.8542435424354244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2123120', 'n_tokens_mistral': 584, 'n_tokens_neox': 564, 'n_words': 148}