summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/config/entry/validator.rb
blob: 2df23a3edcd8b2f326ce617eb607915def838627 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module Gitlab
  module Ci
    class Config
      module Entry
        class Validator < SimpleDelegator
          include ActiveModel::Validations
          include Entry::Validators

          def initialize(entry)
            super(entry)
          end

          def messages
            errors.full_messages.map do |error|
              "#{location} #{error}".downcase
            end
          end

          def self.name
            'Validator'
          end
        end
      end
    end
  end
end