Class: Hyrax::Admin::UserActivityPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/hyrax/admin/user_activity_presenter.rb

Instance Method Summary collapse

Constructor Details

#initializeUserActivityPresenter

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_jsonObject



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