Class: Wings::CustomQueries::FindCollectionsByType
- Inherits:
-
Object
- Object
- Wings::CustomQueries::FindCollectionsByType
- Defined in:
- lib/wings/services/custom_queries/find_collections_by_type.rb
Overview
Instance Attribute Summary collapse
-
#query_service ⇒ Object
readonly
Returns the value of attribute query_service.
Class Method Summary collapse
Instance Method Summary collapse
- #find_collections_by_type(global_id:) ⇒ Enumerable<PcdmCollection>
-
#initialize(query_service:) ⇒ FindCollectionsByType
constructor
A new instance of FindCollectionsByType.
Constructor Details
#initialize(query_service:) ⇒ FindCollectionsByType
Returns a new instance of FindCollectionsByType.
11 12 13 |
# File 'lib/wings/services/custom_queries/find_collections_by_type.rb', line 11 def initialize(query_service:) @query_service = query_service end |
Instance Attribute Details
#query_service ⇒ Object (readonly)
Returns the value of attribute query_service.
15 16 17 |
# File 'lib/wings/services/custom_queries/find_collections_by_type.rb', line 15 def query_service @query_service end |
Class Method Details
.queries ⇒ Object
7 8 9 |
# File 'lib/wings/services/custom_queries/find_collections_by_type.rb', line 7 def self.queries [:find_collections_by_type] end |
Instance Method Details
#find_collections_by_type(global_id:) ⇒ Enumerable<PcdmCollection>
22 23 24 |
# File 'lib/wings/services/custom_queries/find_collections_by_type.rb', line 22 def find_collections_by_type(global_id:) ::Collection.where(Hyrax.config.collection_type_index_field.to_sym => global_id.to_s).map(&:valkyrie_resource) end |