Sha256: bffbf097a4c0b00b8c0b8ffde89996b96796ce140084ccc8b2798519c3ff2f08
Contents?: true
Size: 752 Bytes
Versions: 57
Compression:
Stored size: 752 Bytes
Contents
module Hyrax module Admin class RepositoryGrowthPresenter def initialize @x_min = 90.days.ago.beginning_of_day @date_format = ->(x) { x.strftime('%F') } end 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 private def works Hyrax::Statistics::Works::OverTime.new(x_min: @x_min, x_output: @date_format).points end def collections Hyrax::Statistics::Collections::OverTime.new(x_min: @x_min, x_output: @date_format).points end end end end
Version data entries
57 entries across 57 versions & 1 rubygems