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)
ParseError =
Class.new(StandardError)

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ Clause

Returns a new instance of Clause.



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

def initialize(spec)
  @spec = spec
end

Class Method Details

.fabricate(type, value) ⇒ Object



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

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)


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

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