Class: Gitlab::Ci::Config::Interpolation::Inputs::BooleanInput

Inherits:
BaseInput
  • Object
show all
Extended by:
Utils::Override
Defined in:
lib/gitlab/ci/config/interpolation/inputs/boolean_input.rb

Constant Summary

Constants inherited from BaseInput

Gitlab::Ci::Config::Interpolation::Inputs::BaseInput::ArgumentNotValidError

Instance Attribute Summary

Attributes inherited from BaseInput

#errors, #name, #spec, #value

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils::Override

extended, extensions, included, method_added, override, prepended, queue_verification, verify!

Methods inherited from BaseInput

#initialize, matches?, #to_hash, #valid?

Constructor Details

This class inherits a constructor from Gitlab::Ci::Config::Interpolation::Inputs::BaseInput

Class Method Details

.type_nameObject



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

def self.type_name
  'boolean'
end

Instance Method Details

#validate_type(value, default) ⇒ Object



16
17
18
19
20
# File 'lib/gitlab/ci/config/interpolation/inputs/boolean_input.rb', line 16

def validate_type(value, default)
  return if [true, false].include?(value)

  error("#{default ? 'default' : 'provided'} value is not a boolean")
end