debian-mirror-gitlab/app/serializers/cohort_activity_month_entity.rb

12 lines
333 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
class CohortActivityMonthEntity < Grape::Entity
include ActionView::Helpers::NumberHelper
expose :total do |cohort_activity_month|
number_with_delimiter(cohort_activity_month[:total])
end
expose :percentage do |cohort_activity_month|
number_to_percentage(cohort_activity_month[:percentage], precision: 0)
end
end