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

15 lines
352 B
Ruby
Raw Normal View History

2021-02-22 17:27:13 +05:30
# frozen_string_literal: true
class CodequalityDegradationEntity < Grape::Entity
expose :description
expose :severity
expose :file_path do |degradation|
degradation.dig(:location, :path)
end
expose :line do |degradation|
degradation.dig(:location, :lines, :begin) || degradation.dig(:location, :positions, :begin, :line)
end
end