Class: CurationConcerns::ResourceStatisticsSource
- Inherits:
-
Object
- Object
- CurationConcerns::ResourceStatisticsSource
- Defined in:
- app/sources/curation_concerns/resource_statistics_source.rb
Instance Attribute Summary collapse
-
#repository ⇒ Object
Returns the value of attribute repository.
-
#search_builder ⇒ Object
Returns the value of attribute search_builder.
Instance Method Summary collapse
- #active_embargo_now_authenticated_concerns_count ⇒ Object
- #active_embargo_now_restricted_concerns_count ⇒ Object
- #active_lease_now_authenticated_concerns_count ⇒ Object
- #active_lease_now_open_concerns_count ⇒ Object
- #authenticated_concerns_count ⇒ Object
- #expired_embargo_now_authenticated_concerns_count ⇒ Object
- #expired_embargo_now_open_concerns_count ⇒ Object
- #expired_lease_now_authenticated_concerns_count ⇒ Object
- #expired_lease_now_restricted_concerns_count ⇒ Object
-
#initialize(search_builder: ::CurationConcerns::AdminController.new.search_builder, repository: ::CurationConcerns::AdminController.new.repository) ⇒ ResourceStatisticsSource
constructor
A new instance of ResourceStatisticsSource.
- #open_concerns_count ⇒ Object
- #restricted_concerns_count ⇒ Object
Constructor Details
#initialize(search_builder: ::CurationConcerns::AdminController.new.search_builder, repository: ::CurationConcerns::AdminController.new.repository) ⇒ ResourceStatisticsSource
Returns a new instance of ResourceStatisticsSource.
4 5 6 7 8 9 10 |
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 4 def initialize(search_builder: ::CurationConcerns::AdminController.new.search_builder, repository: ::CurationConcerns::AdminController.new.repository) # Remove gated discovery. @search_builder = search_builder.except(:add_access_controls_to_solr_params) @repository = repository solr_arguments[:fq] ||= [] solr_arguments[:rows] = 0 end |
Instance Attribute Details
#repository ⇒ Object
Returns the value of attribute repository.
3 4 5 |
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 3 def repository @repository end |
#search_builder ⇒ Object
Returns the value of attribute search_builder.
3 4 5 |
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 3 def search_builder @search_builder end |
Instance Method Details
#active_embargo_now_authenticated_concerns_count ⇒ Object
32 33 34 |
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 32 def results_count([registered_read_group, ]) end |
#active_embargo_now_restricted_concerns_count ⇒ Object
36 37 38 |
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 36 def results_count([not_registered_read_group, not_public_read_group, ]) end |
#active_lease_now_authenticated_concerns_count ⇒ Object
48 49 50 |
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 48 def active_lease_now_authenticated_concerns_count results_count([registered_read_group, active_lease]) end |
#active_lease_now_open_concerns_count ⇒ Object
52 53 54 |
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 52 def active_lease_now_open_concerns_count results_count([public_read_group, active_lease]) end |
#authenticated_concerns_count ⇒ Object
16 17 18 |
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 16 def authenticated_concerns_count results_count(registered_read_group) end |
#expired_embargo_now_authenticated_concerns_count ⇒ Object
24 25 26 |
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 24 def results_count([registered_read_group, ]) end |
#expired_embargo_now_open_concerns_count ⇒ Object
28 29 30 |
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 28 def results_count([public_read_group, ]) end |
#expired_lease_now_authenticated_concerns_count ⇒ Object
40 41 42 |
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 40 def expired_lease_now_authenticated_concerns_count results_count([registered_read_group, lease_history_query]) end |
#expired_lease_now_restricted_concerns_count ⇒ Object
44 45 46 |
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 44 def expired_lease_now_restricted_concerns_count results_count([not_registered_read_group, not_public_read_group, lease_history_query]) end |
#open_concerns_count ⇒ Object
12 13 14 |
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 12 def open_concerns_count results_count(public_read_group) end |
#restricted_concerns_count ⇒ Object
20 21 22 |
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 20 def restricted_concerns_count results_count([not_registered_read_group, not_public_read_group]) end |