Class: Hyrax::Statistics::Depositors::Summary
- Inherits:
-
Object
- Object
- Hyrax::Statistics::Depositors::Summary
- Defined in:
- app/services/hyrax/statistics/depositors/summary.rb
Overview
Gather information about the depositors who have contributed to the repository
Instance Attribute Summary collapse
-
#end_dt ⇒ Object
Returns the value of attribute end_dt.
-
#start_dt ⇒ Object
Returns the value of attribute start_dt.
Class Method Summary collapse
-
.depositors(start_date:, end_date:) ⇒ Array<Hash>
With keys of: :key, :deposits, and :user.
Instance Method Summary collapse
- #depositors ⇒ Object
-
#initialize(start_date, end_date) ⇒ Summary
constructor
A new instance of Summary.
Constructor Details
#initialize(start_date, end_date) ⇒ Summary
Returns a new instance of Summary.
18 19 20 21 |
# File 'app/services/hyrax/statistics/depositors/summary.rb', line 18 def initialize(start_date, end_date) @start_dt = start_date @end_dt = end_date end |
Instance Attribute Details
#end_dt ⇒ Object
Returns the value of attribute end_dt.
23 24 25 |
# File 'app/services/hyrax/statistics/depositors/summary.rb', line 23 def end_dt @end_dt end |
#start_dt ⇒ Object
Returns the value of attribute start_dt.
23 24 25 |
# File 'app/services/hyrax/statistics/depositors/summary.rb', line 23 def start_dt @start_dt end |
Class Method Details
.depositors(start_date:, end_date:) ⇒ Array<Hash>
Returns With keys of: :key, :deposits, and :user.
12 13 14 |
# File 'app/services/hyrax/statistics/depositors/summary.rb', line 12 def self.depositors(start_date:, end_date:) new(start_date, end_date).depositors end |
Instance Method Details
#depositors ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'app/services/hyrax/statistics/depositors/summary.rb', line 25 def depositors # step through the array by twos to get each pair results.map do |key, deposits| user = ::User.find_by_user_key(key) raise "Unable to find user '#{key}'\nResults was: #{results.inspect}" unless user { key: key, deposits: deposits, user: user } end end |