Class: Sufia::AdminStatsPresenter
- Inherits:
-
Object
- Object
- Sufia::AdminStatsPresenter
- Defined in:
- app/presenters/sufia/admin_stats_presenter.rb
Instance Attribute Summary collapse
-
#deposit_stats ⇒ Object
Returns the value of attribute deposit_stats.
-
#depositors ⇒ Object
Returns the value of attribute depositors.
-
#end_date ⇒ Object
readonly
Returns the value of attribute end_date.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#start_date ⇒ Object
readonly
Returns the value of attribute start_date.
-
#stats_filters ⇒ Object
readonly
Returns the value of attribute stats_filters.
Instance Method Summary collapse
- #active_users ⇒ Object
- #date_filter_string ⇒ Object
- #files_count ⇒ Object
-
#initialize(stats_filters, limit) ⇒ AdminStatsPresenter
constructor
A new instance of AdminStatsPresenter.
- #recent_users ⇒ Object
- #top_formats ⇒ Object
- #users_count ⇒ Object
Constructor Details
#initialize(stats_filters, limit) ⇒ AdminStatsPresenter
Returns a new instance of AdminStatsPresenter.
6 7 8 9 10 11 |
# File 'app/presenters/sufia/admin_stats_presenter.rb', line 6 def initialize(stats_filters, limit) @stats_filters = stats_filters @start_date = stats_filters[:start_date] @end_date = stats_filters[:end_date] @limit = limit end |
Instance Attribute Details
#deposit_stats ⇒ Object
Returns the value of attribute deposit_stats.
3 4 5 |
# File 'app/presenters/sufia/admin_stats_presenter.rb', line 3 def deposit_stats @deposit_stats end |
#depositors ⇒ Object
Returns the value of attribute depositors.
3 4 5 |
# File 'app/presenters/sufia/admin_stats_presenter.rb', line 3 def depositors @depositors end |
#end_date ⇒ Object (readonly)
Returns the value of attribute end_date.
4 5 6 |
# File 'app/presenters/sufia/admin_stats_presenter.rb', line 4 def end_date @end_date end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
4 5 6 |
# File 'app/presenters/sufia/admin_stats_presenter.rb', line 4 def limit @limit end |
#start_date ⇒ Object (readonly)
Returns the value of attribute start_date.
4 5 6 |
# File 'app/presenters/sufia/admin_stats_presenter.rb', line 4 def start_date @start_date end |
#stats_filters ⇒ Object (readonly)
Returns the value of attribute stats_filters.
4 5 6 |
# File 'app/presenters/sufia/admin_stats_presenter.rb', line 4 def stats_filters @stats_filters end |
Instance Method Details
#active_users ⇒ Object
17 18 19 |
# File 'app/presenters/sufia/admin_stats_presenter.rb', line 17 def active_users @active_users ||= stats.top_depositors end |
#date_filter_string ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'app/presenters/sufia/admin_stats_presenter.rb', line 33 def date_filter_string if start_date.blank? "unfiltered" elsif end_date.blank? "#{start_date} to #{Date.current}" else "#{start_date} to #{end_date}" end end |
#files_count ⇒ Object
25 26 27 |
# File 'app/presenters/sufia/admin_stats_presenter.rb', line 25 def files_count @files_count ||= stats. end |
#recent_users ⇒ Object
13 14 15 |
# File 'app/presenters/sufia/admin_stats_presenter.rb', line 13 def recent_users @recent_users ||= stats.recent_users end |
#top_formats ⇒ Object
21 22 23 |
# File 'app/presenters/sufia/admin_stats_presenter.rb', line 21 def top_formats @top_formats ||= stats.top_formats end |
#users_count ⇒ Object
29 30 31 |
# File 'app/presenters/sufia/admin_stats_presenter.rb', line 29 def users_count @users_count ||= stats.users_count end |