Sha256: 09f52f9e1293c59bc2dc62c0ff4d49ff6a1891b216b39dc1e9395be3db3cd9d9
Contents?: true
Size: 1.04 KB
Versions: 17
Compression:
Stored size: 1.04 KB
Contents
# frozen_string_literal: true module Hyrax module Admin class RepositoryGrowthPresenter def initialize(start_date, end_date) @x_min = start_date @x_max = end_date @date_format = ->(x) { x.strftime('%F') } end def as_json(*) works.to_a.zip(collections.to_a).map do |e| { y: e.first.first, works: e.first.last, collections: e.last.last } end end private def works Hyrax::Statistics::Works::OverTime.new(delta_x: 1, x_min: @x_min, x_max: @x_max, x_output: @date_format).points end def collections Hyrax::Statistics::Collections::OverTime.new(delta_x: 1, x_min: @x_min, x_max: @x_max, x_output: @date_format).points end end end end
Version data entries
17 entries across 17 versions & 1 rubygems