2016-11-21 16:15:25 +00:00
|
|
|
class AnalyticsStageEntity < Grape::Entity
|
|
|
|
include EntityDateHelper
|
|
|
|
|
2016-12-01 10:21:24 +00:00
|
|
|
expose :title
|
2017-05-04 02:05:38 +00:00
|
|
|
expose :name
|
2017-02-10 08:41:39 +00:00
|
|
|
expose :legend
|
2016-11-21 16:15:25 +00:00
|
|
|
expose :description
|
|
|
|
|
2018-02-09 14:10:58 +00:00
|
|
|
expose :medians, as: :values do |stage|
|
|
|
|
medians = stage.medians
|
|
|
|
|
|
|
|
unless medians.blank?
|
|
|
|
medians.each do |id, median|
|
|
|
|
medians[id] = distance_of_time_in_words(median)
|
|
|
|
end
|
|
|
|
end
|
2016-11-21 16:15:25 +00:00
|
|
|
end
|
|
|
|
end
|