Class: Gitlab::Ci::Config::Interpolation::Functions::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/ci/config/interpolation/functions/base.rb

Direct Known Subclasses

Truncate

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(function_expression) ⇒ Base

Returns a new instance of Base.



23
24
25
26
# File 'lib/gitlab/ci/config/interpolation/functions/base.rb', line 23

def initialize(function_expression)
  @errors = []
  @function_args = parse_args(function_expression)
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



9
10
11
# File 'lib/gitlab/ci/config/interpolation/functions/base.rb', line 9

def errors
  @errors
end

Class Method Details

.function_expression_patternObject

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/gitlab/ci/config/interpolation/functions/base.rb', line 11

def self.function_expression_pattern
  raise NotImplementedError
end

.matches?(function_expression) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/gitlab/ci/config/interpolation/functions/base.rb', line 19

def self.matches?(function_expression)
  function_expression_pattern.match?(function_expression)
end

.nameObject

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/gitlab/ci/config/interpolation/functions/base.rb', line 15

def self.name
  raise NotImplementedError
end

Instance Method Details

#execute(_input_value) ⇒ Object

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/gitlab/ci/config/interpolation/functions/base.rb', line 32

def execute(_input_value)
  raise NotImplementedError
end

#valid?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/gitlab/ci/config/interpolation/functions/base.rb', line 28

def valid?
  errors.empty?
end