Class: CurationConcerns::ResourceStatisticsSource

Inherits:
Object
  • Object
show all
Defined in:
app/sources/curation_concerns/resource_statistics_source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#repositoryObject

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_builderObject

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_countObject



32
33
34
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 32

def active_embargo_now_authenticated_concerns_count
  results_count([registered_read_group, active_embargo])
end

#active_embargo_now_restricted_concerns_countObject



36
37
38
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 36

def active_embargo_now_restricted_concerns_count
  results_count([not_registered_read_group, not_public_read_group, active_embargo])
end

#active_lease_now_authenticated_concerns_countObject



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_countObject



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_countObject



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_countObject



24
25
26
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 24

def expired_embargo_now_authenticated_concerns_count
  results_count([registered_read_group, embargo_history_query])
end

#expired_embargo_now_open_concerns_countObject



28
29
30
# File 'app/sources/curation_concerns/resource_statistics_source.rb', line 28

def expired_embargo_now_open_concerns_count
  results_count([public_read_group, embargo_history_query])
end

#expired_lease_now_authenticated_concerns_countObject



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_countObject



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_countObject



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_countObject



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