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



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

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

#attributesObject (readonly)

Returns the value of attribute attributes.



13
14
15
# File 'app/actors/hyrax/actors/environment.rb', line 13

def attributes
  @attributes
end

#curation_concernObject (readonly)

Returns the value of attribute curation_concern.



13
14
15
# File 'app/actors/hyrax/actors/environment.rb', line 13

def curation_concern
  @curation_concern
end

#current_abilityObject (readonly)

Returns the value of attribute current_ability.



13
14
15
# File 'app/actors/hyrax/actors/environment.rb', line 13

def current_ability
  @current_ability
end

Instance Method Details

#userUser

Returns the user from the current_ability.

Returns:

  • (User)

    the user from the current_ability



16
17
18
# File 'app/actors/hyrax/actors/environment.rb', line 16

def user
  current_ability.current_user
end