Class: Gitlab::Ci::Config::Entry::Needs
- Inherits:
-
Gitlab::Config::Entry::Node
- Object
- Gitlab::Config::Entry::Node
- Gitlab::Ci::Config::Entry::Needs
- Includes:
- Gitlab::Config::Entry::Validatable
- Defined in:
- lib/gitlab/ci/config/entry/needs.rb
Overview
Entry that represents a set of needs dependencies.
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
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/gitlab/ci/config/entry/needs.rb', line 32 def compose!(deps = nil) super(deps) do [@config].flatten.each_with_index do |need, index| @entries[index] = ::Gitlab::Config::Entry::Factory.new(Entry::Need) .value(need) .with(key: "need", parent: self, description: "need definition.") # rubocop:disable CodeReuse/ActiveRecord .create! end @entries.each_value do |entry| entry.compose!(deps) end end end |
#value ⇒ Object
47 48 49 50 51 52 |
# File 'lib/gitlab/ci/config/entry/needs.rb', line 47 def value values = @entries.values.select(&:type) values.group_by(&:type).transform_values do |values| values.map(&:value) end end |