summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/config/node/validator.rb
blob: 02edc9219c395330ee2fc6eac9bfbceb6373858c (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
27
module Gitlab
  module Ci
    class Config
      module Node
        class Validator < SimpleDelegator
          include ActiveModel::Validations
          include Node::Validators

          def initialize(node)
            super(node)
            @node = node
          end

          def full_errors
            errors.full_messages.map do |error|
              "#{@node.key} #{error}".humanize
            end
          end

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