Class: Hyrax::Admin::RepositoryGrowthPresenter

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

Instance Method Summary collapse

Constructor Details

#initializeRepositoryGrowthPresenter

Returns a new instance of RepositoryGrowthPresenter.



4
5
6
7
# File 'app/presenters/hyrax/admin/repository_growth_presenter.rb', line 4

def initialize
  @x_min = 90.days.ago.beginning_of_day
  @date_format = ->(x) { x.strftime('%F') }
end

Instance Method Details

#as_jsonObject



9
10
11
12
13
# File 'app/presenters/hyrax/admin/repository_growth_presenter.rb', line 9

def as_json(*)
  works.to_a.zip(collections.to_a).map do |e|
    { y: e.first.first, a: e.first.last, b: e.last.last }
  end
end