Class: Hyrax::Admin::UserActivityPresenter
- Inherits:
-
Object
- Object
- Hyrax::Admin::UserActivityPresenter
- Defined in:
- app/presenters/hyrax/admin/user_activity_presenter.rb
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize ⇒ UserActivityPresenter
constructor
A new instance of UserActivityPresenter.
Constructor Details
#initialize ⇒ UserActivityPresenter
Returns a new instance of UserActivityPresenter.
4 5 6 7 |
# File 'app/presenters/hyrax/admin/user_activity_presenter.rb', line 4 def initialize @x_min = 90.days.ago.beginning_of_day @date_format = ->(x) { x.strftime('%b %-d') } end |
Instance Method Details
#as_json ⇒ Object
9 10 11 12 13 |
# File 'app/presenters/hyrax/admin/user_activity_presenter.rb', line 9 def as_json(*) new_users.to_a.zip(returning_users.to_a).map do |e| { y: e.first.first, a: e.first.last, b: e.last.try(:last) } end end |