Class: CurationConcerns::AdminSetService
- Inherits:
-
Object
- Object
- CurationConcerns::AdminSetService
- Defined in:
- app/services/curation_concerns/admin_set_service.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#search_builder ⇒ Object
readonly
Returns the value of attribute search_builder.
Instance Method Summary collapse
-
#initialize(context, search_builder = default_search_builder) ⇒ AdminSetService
constructor
A new instance of AdminSetService.
- #search_results(access) ⇒ Object
- #select_options(access = :read) ⇒ Object
Constructor Details
#initialize(context, search_builder = default_search_builder) ⇒ AdminSetService
Returns a new instance of AdminSetService.
8 9 10 11 |
# File 'app/services/curation_concerns/admin_set_service.rb', line 8 def initialize(context, search_builder = default_search_builder) @context = context @search_builder = search_builder end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
3 4 5 |
# File 'app/services/curation_concerns/admin_set_service.rb', line 3 def context @context end |
#search_builder ⇒ Object (readonly)
Returns the value of attribute search_builder.
3 4 5 |
# File 'app/services/curation_concerns/admin_set_service.rb', line 3 def search_builder @search_builder end |
Instance Method Details
#search_results(access) ⇒ Object
21 22 23 24 |
# File 'app/services/curation_concerns/admin_set_service.rb', line 21 def search_results(access) response = context.repository.search(builder(access)) response.documents end |
#select_options(access = :read) ⇒ Object
14 15 16 17 18 |
# File 'app/services/curation_concerns/admin_set_service.rb', line 14 def (access = :read) search_results(access).map do |element| [element.to_s, element.id] end end |