Sha256: 75704654a867f6888e65a6a6975c157e175e24d9e30c5febfab93d2938d68578

Contents?: true

Size: 844 Bytes

Versions: 19

Compression:

Stored size: 844 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  ##
  # A simple data object for holding a user, work and their workflow proxies
  #
  # this is a glorified Struct that resolves +Sipity::Enitity(work)+
  # and +Sipity::Agent(user)+ for the input given, then provides readers
  # for its instance variables.
  #
  # @example
  #   info = WorkflowActionInfo.new(my_work, current_user)
  #
  #   info.agent # =>  #<Sipity::Agent...>
  #   info.entity # =>  #<Sipity::Entity...>
  #   info.work == my_work # => true
  #   info.user == current_user # => true
  class WorkflowActionInfo
    ##
    # @param work [Object]
    # @param user [::User]
    def initialize(work, user)
      @work = work
      @user = user
      @entity = Sipity::Entity(work)
      @agent = Sipity::Agent(user)
    end

    attr_reader :entity, :agent, :user, :work
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
hyrax-5.0.2 app/models/hyrax/workflow_action_info.rb
hyrax-5.0.1 app/models/hyrax/workflow_action_info.rb
hyrax-5.0.0 app/models/hyrax/workflow_action_info.rb
hyrax-5.0.0.rc3 app/models/hyrax/workflow_action_info.rb
hyrax-5.0.0.rc2 app/models/hyrax/workflow_action_info.rb
hyrax-5.0.0.rc1 app/models/hyrax/workflow_action_info.rb
hyrax-3.6.0 app/models/hyrax/workflow_action_info.rb
hyrax-4.0.0 app/models/hyrax/workflow_action_info.rb
hyrax-4.0.0.rc3 app/models/hyrax/workflow_action_info.rb
hyrax-4.0.0.rc2 app/models/hyrax/workflow_action_info.rb
hyrax-4.0.0.rc1 app/models/hyrax/workflow_action_info.rb
hyrax-3.5.0 app/models/hyrax/workflow_action_info.rb
hyrax-4.0.0.beta2 app/models/hyrax/workflow_action_info.rb
hyrax-3.4.2 app/models/hyrax/workflow_action_info.rb
hyrax-4.0.0.beta1 app/models/hyrax/workflow_action_info.rb
hyrax-3.4.1 app/models/hyrax/workflow_action_info.rb
hyrax-3.4.0 app/models/hyrax/workflow_action_info.rb
hyrax-3.3.0 app/models/hyrax/workflow_action_info.rb
hyrax-3.2.0 app/models/hyrax/workflow_action_info.rb