Class: Gitlab::Ci::Config::Entry::Rules

Inherits:
Gitlab::Config::Entry::Node show all
Includes:
Gitlab::Config::Entry::Validatable
Defined in:
lib/gitlab/ci/config/entry/rules.rb

Defined Under Namespace

Classes: Rule

Constant Summary

Constants inherited from Gitlab::Config::Entry::Node

Gitlab::Config::Entry::Node::InvalidError

Instance Attribute Summary

Attributes inherited from Gitlab::Config::Entry::Node

#config, #default, #description, #key, #metadata, #parent

Instance Method Summary collapse

Methods included from Gitlab::Config::Entry::Validatable

#errors, included, #validate, #validator

Methods inherited from Gitlab::Config::Entry::Node

#[], #add_warning, #ancestors, aspects, default, #descendants, #errors, #hash?, #initialize, #inspect, #integer?, #leaf?, #location, #opt, #relevant?, #specified?, #string?, #valid?, #warnings, with_aspect

Constructor Details

This class inherits a constructor from Gitlab::Config::Entry::Node

Instance Method Details

#compose!(deps = nil) ⇒ Object


15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/gitlab/ci/config/entry/rules.rb', line 15

def compose!(deps = nil)
  super(deps) do
    @config.each_with_index do |rule, index|
      @entries[index] = ::Gitlab::Config::Entry::Factory.new(Entry::Rules::Rule)
        .value(rule)
        .with(key: "rule", parent: self, description: "rule definition.") # rubocop:disable CodeReuse/ActiveRecord
        .create!
    end

    @entries.each_value do |entry|
      entry.compose!(deps)
    end
  end
end

#valueObject


30
31
32
# File 'lib/gitlab/ci/config/entry/rules.rb', line 30

def value
  @config
end