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.
-
#proxy_class ⇒ Object
readonly
Returns the value of attribute proxy_class.
-
#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:, proxy_class:) ⇒ ContainedFinder
constructor
A new instance of ContainedFinder.
Constructor Details
#initialize(container:, repository:, proxy_class:) ⇒ ContainedFinder
Returns a new instance of ContainedFinder.
14 15 16 17 18 |
# File 'lib/active_fedora/associations/contained_finder.rb', line 14 def initialize(container:, repository:, proxy_class:) @container = container @repository = repository @proxy_class = proxy_class 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 |
#proxy_class ⇒ Object (readonly)
Returns the value of attribute proxy_class.
6 7 8 |
# File 'lib/active_fedora/associations/contained_finder.rb', line 6 def proxy_class @proxy_class 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.
24 25 26 27 |
# File 'lib/active_fedora/associations/contained_finder.rb', line 24 def find(record) record.reload repository.find(matching_ids(record)) end |