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

29 lines
599 B
Ruby
Raw Normal View History

2021-03-08 18:12:59 +05:30
# frozen_string_literal: true
module Atlassian
module JiraConnect
module Serializers
class EnvironmentEntity < Grape::Entity
format_with(:string, &:to_s)
expose :id, format_with: :string
expose :display_name, as: :displayName
expose :type
private
alias_method :environment, :object
delegate :project, to: :object
def display_name
"#{project.name}/#{environment.name}"
end
def type
2022-05-07 20:08:51 +05:30
environment.tier == 'other' ? 'unmapped' : environment.tier
2021-03-08 18:12:59 +05:30
end
end
end
end
end