Class: ActiveFedora::Associations::ContainedFinder
- Inherits:
-
Object
- Object
- ActiveFedora::Associations::ContainedFinder
- Defined in:
- lib/active_fedora/associations/contained_finder.rb
Overview
Finds the objects which associate with a given record and are contained within the given container. Uses #repository to find the objects.
Instance Attribute Summary collapse
-
#container ⇒ Object
readonly
Returns the value of attribute container.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
Instance Method Summary collapse
-
#find(record) ⇒ Array<ActiveFedora::Base>
This returns whatever type repository.find returns.
-
#initialize(container:, repository:) ⇒ ContainedFinder
constructor
A new instance of ContainedFinder.
Constructor Details
#initialize(container:, repository:) ⇒ ContainedFinder
Returns a new instance of ContainedFinder.
12 13 14 15 |
# File 'lib/active_fedora/associations/contained_finder.rb', line 12 def initialize(container:, repository:) @container = container @repository = repository end |
Instance Attribute Details
#container ⇒ Object (readonly)
Returns the value of attribute container.
6 7 8 |
# File 'lib/active_fedora/associations/contained_finder.rb', line 6 def container @container end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
6 7 8 |
# File 'lib/active_fedora/associations/contained_finder.rb', line 6 def repository @repository end |
Instance Method Details
#find(record) ⇒ Array<ActiveFedora::Base>
Returns This returns whatever type repository.find returns.
21 22 23 24 |
# File 'lib/active_fedora/associations/contained_finder.rb', line 21 def find(record) record.reload repository.find(matching_ids(record)) end |