debian-mirror-gitlab/lib/atlassian/jira_connect/serializers/base_entity.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
607 B
Ruby
Raw Normal View History

2020-11-24 15:15:51 +05:30
# 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 }
2021-01-29 00:20:46 +05:30
expose :update_sequence_id, as: :updateSequenceId
2020-11-24 15:15:51 +05:30
2021-02-22 17:27:13 +05:30
def eql(other)
other.is_a?(self.class) && to_json == other.to_json
end
alias_method :==, :eql
2020-11-24 15:15:51 +05:30
private
2021-01-29 00:20:46 +05:30
def update_sequence_id
options[:update_sequence_id] || Client.generate_update_sequence_id
2020-11-24 15:15:51 +05:30
end
end
end
end
end