Class: Gitlab::Ci::Build::Rules::Rule::Clause

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/ci/build/rules/rule/clause.rb

Direct Known Subclasses

Changes, Exists, If

Defined Under Namespace

Classes: Changes, Exists, If

Constant Summary collapse

UnknownClauseError =

Abstract class that defines an interface of a single job rule specification.

Used for job's inclusion rules configuration.

Class.new(StandardError)

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ Clause

Returns a new instance of Clause.


19
20
21
# File 'lib/gitlab/ci/build/rules/rule/clause.rb', line 19

def initialize(spec)
  @spec = spec
end

Class Method Details

.fabricate(type, value) ⇒ Object


15
16
17
# File 'lib/gitlab/ci/build/rules/rule/clause.rb', line 15

def self.fabricate(type, value)
  "#{self}::#{type.to_s.camelize}".safe_constantize&.new(value)
end

Instance Method Details

#satisfied_by?(pipeline, context = nil) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)

23
24
25
# File 'lib/gitlab/ci/build/rules/rule/clause.rb', line 23

def satisfied_by?(pipeline, context = nil)
  raise NotImplementedError
end