Class: Hyrax::Actors::Environment

Inherits:
Object
  • Object
show all
Defined in:
app/actors/hyrax/actors/environment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(curation_concern, current_ability, attributes) ⇒ Environment

Returns a new instance of Environment.

Parameters:

  • curation_concern (ActiveFedora::Base)

    work to operate on

  • current_ability (Ability)

    the authorizations of the acting user

  • attributes (ActionController::Parameters)

    user provided form attributes



8
9
10
11
12
# File 'app/actors/hyrax/actors/environment.rb', line 8

def initialize(curation_concern, current_ability, attributes)
  @curation_concern = curation_concern
  @current_ability = current_ability
  @attributes = attributes.to_h.with_indifferent_access
end

Instance Attribute Details

#attributesHash

Returns:

  • (Hash)


21
22
23
# File 'app/actors/hyrax/actors/environment.rb', line 21

def attributes
  @attributes
end

#curation_concernObject

Returns:

  • (Object)


21
# File 'app/actors/hyrax/actors/environment.rb', line 21

attr_accessor :attributes, :curation_concern, :current_ability

#current_abilityHyrax::Ability

Returns:



21
# File 'app/actors/hyrax/actors/environment.rb', line 21

attr_accessor :attributes, :curation_concern, :current_ability

Instance Method Details

#userUser

Returns the user from the current_ability.

Returns:

  • (User)

    the user from the current_ability



24
25
26
# File 'app/actors/hyrax/actors/environment.rb', line 24

def user
  current_ability.current_user
end