Class: Hyrax::Admin::RepositoryGrowthPresenter
- Inherits:
-
Object
- Object
- Hyrax::Admin::RepositoryGrowthPresenter
- Defined in:
- app/presenters/hyrax/admin/repository_growth_presenter.rb
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize ⇒ RepositoryGrowthPresenter
constructor
A new instance of RepositoryGrowthPresenter.
Constructor Details
#initialize ⇒ RepositoryGrowthPresenter
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_json ⇒ Object
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 |