summaryrefslogtreecommitdiff
path: root/lib/atlassian/jira_connect/serializers/base_entity.rb
blob: c5490aa3f54419ef2e826f4fb9cf7329e96e2aa3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

module Atlassian
  module JiraConnect
    module Serializers
      class BaseEntity < Grape::Entity
        include Gitlab::Routing
        include GitlabRoutingHelper

        format_with(:string) { |value| value.to_s }

        expose :monotonic_time, as: :updateSequenceId

        private

        def monotonic_time
          Gitlab::Metrics::System.monotonic_time.to_i
        end
      end
    end
  end
end