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 # frozen_string_literal: true
module Ci module Ci
class InstanceVariableEntity < Grape::Entity class BasicVariableEntity < Grape::Entity
expose :id expose :id
expose :key expose :key
expose :value expose :value
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
module Ci module Ci
class InstanceVariableSerializer < BaseSerializer class InstanceVariableSerializer < BaseSerializer
entity InstanceVariableEntity entity BasicVariableEntity
end end
end end
# frozen_string_literal: true # frozen_string_literal: true
class GroupVariableEntity < Grape::Entity class GroupVariableEntity < Ci::BasicVariableEntity
expose :id
expose :key
expose :value
expose :variable_type
expose :protected?, as: :protected
expose :masked?, as: :masked
end end
# frozen_string_literal: true # frozen_string_literal: true
class VariableEntity < Grape::Entity class VariableEntity < Ci::BasicVariableEntity
expose :id
expose :key
expose :value
expose :variable_type
expose :protected?, as: :protected
expose :masked?, as: :masked
expose :environment_scope expose :environment_scope
end 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