Class: Ci::Inputs::BooleanInput

Inherits:
BaseInput show all
Extended by:
Gitlab::Utils::Override
Defined in:
lib/ci/inputs/boolean_input.rb

Instance Attribute Summary

Attributes inherited from BaseInput

#errors, #name, #spec

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::Utils::Override

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

Methods inherited from BaseInput

#actual_value, #default, #default_value_present?, #description, #initialize, matches?, #options, #regex, #required?, #rules, #type, #validate_param!

Constructor Details

This class inherits a constructor from Ci::Inputs::BaseInput

Class Method Details

.type_nameObject



8
9
10
# File 'lib/ci/inputs/boolean_input.rb', line 8

def self.type_name
  'boolean'
end

Instance Method Details

#validate_type(value, default) ⇒ Object



13
14
15
16
17
# File 'lib/ci/inputs/boolean_input.rb', line 13

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

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