Class: Hyrax::ResourceVisibilityPropagator
- Inherits:
-
Object
- Object
- Hyrax::ResourceVisibilityPropagator
- Defined in:
- app/services/hyrax/resource_visibility_propagator.rb
Overview
Propagates visibility from a valkyrie Work to its FileSets
Instance Attribute Summary collapse
- #embargo_manager ⇒ Hyrax::EmbargoManager readonly
- #lease_manager ⇒ Hyrax::LeaseManager readonly
- #persister ⇒ #save readonly
-
#queries ⇒ Object
readonly
Returns the value of attribute queries.
- #source ⇒ #visibility
Instance Method Summary collapse
-
#initialize(source:, embargo_manager: Hyrax::EmbargoManager, lease_manager: Hyrax::LeaseManager, persister: Hyrax.persister, queries: Hyrax.custom_queries) ⇒ ResourceVisibilityPropagator
constructor
A new instance of ResourceVisibilityPropagator.
- #propagate ⇒ void
Constructor Details
#initialize(source:, embargo_manager: Hyrax::EmbargoManager, lease_manager: Hyrax::LeaseManager, persister: Hyrax.persister, queries: Hyrax.custom_queries) ⇒ ResourceVisibilityPropagator
Returns a new instance of ResourceVisibilityPropagator.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/services/hyrax/resource_visibility_propagator.rb', line 25 def initialize(source:, embargo_manager: Hyrax::EmbargoManager, lease_manager: Hyrax::LeaseManager, persister: Hyrax.persister, queries: Hyrax.custom_queries) @persister = persister @queries = queries self.source = source @embargo_manager = .new(resource: source) @lease_manager = lease_manager.new(resource: source) end |
Instance Attribute Details
#embargo_manager ⇒ Hyrax::EmbargoManager (readonly)
21 22 23 |
# File 'app/services/hyrax/resource_visibility_propagator.rb', line 21 def @embargo_manager end |
#lease_manager ⇒ Hyrax::LeaseManager (readonly)
21 |
# File 'app/services/hyrax/resource_visibility_propagator.rb', line 21 attr_reader :embargo_manager, :lease_manager, :persister, :queries |
#persister ⇒ #save (readonly)
21 |
# File 'app/services/hyrax/resource_visibility_propagator.rb', line 21 attr_reader :embargo_manager, :lease_manager, :persister, :queries |
#queries ⇒ Object (readonly)
Returns the value of attribute queries.
21 |
# File 'app/services/hyrax/resource_visibility_propagator.rb', line 21 attr_reader :embargo_manager, :lease_manager, :persister, :queries |
#source ⇒ #visibility
10 11 12 |
# File 'app/services/hyrax/resource_visibility_propagator.rb', line 10 def source @source end |
Instance Method Details
#propagate ⇒ void
This method returns an undefined value.
41 42 43 44 45 46 47 48 49 50 |
# File 'app/services/hyrax/resource_visibility_propagator.rb', line 41 def propagate queries.find_child_file_sets(resource: source).each do |file_set| file_set.visibility = source.visibility .(target: file_set) lease_manager.copy_lease_to(target: file_set) file_set..acl.save persister.save(resource: file_set) end end |