Commit 96df491e authored by Marius Bobin's avatar Marius Bobin

Unify variables serializers

Extract common elements from variables serializers into a new
base class.
parent b4ba3082
# frozen_string_literal: true
module Ci
class InstanceVariableEntity < Grape::Entity
class BasicVariableEntity < Grape::Entity
expose :id
expose :key
expose :value
......
......@@ -2,6 +2,6 @@
module Ci
class InstanceVariableSerializer < BaseSerializer
entity InstanceVariableEntity
entity BasicVariableEntity
end
end
# frozen_string_literal: true
class GroupVariableEntity < Grape::Entity
expose :id
expose :key
expose :value
expose :variable_type
expose :protected?, as: :protected
expose :masked?, as: :masked
class GroupVariableEntity < Ci::BasicVariableEntity
end
# frozen_string_literal: true
class VariableEntity < Grape::Entity
expose :id
expose :key
expose :value
expose :variable_type
expose :protected?, as: :protected
expose :masked?, as: :masked
class VariableEntity < Ci::BasicVariableEntity
expose :environment_scope
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment