Class: Gitlab::Ci::Config::Interpolation::Inputs::NumberInput
- Inherits:
-
BaseInput
- Object
- BaseInput
- Gitlab::Ci::Config::Interpolation::Inputs::NumberInput
- Extended by:
- Utils::Override
- Defined in:
- lib/gitlab/ci/config/interpolation/inputs/number_input.rb
Constant Summary
Constants inherited from BaseInput
BaseInput::ArgumentNotValidError
Instance Attribute Summary
Attributes inherited from BaseInput
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_name ⇒ Object
11 12 13 |
# File 'lib/gitlab/ci/config/interpolation/inputs/number_input.rb', line 11 def self.type_name 'number' end |
Instance Method Details
#validate_options(value) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/gitlab/ci/config/interpolation/inputs/number_input.rb', line 23 def (value) return unless && value return if .include?(value) error("`#{value}` cannot be used because it is not in the list of the allowed options") end |
#validate_type(value, default) ⇒ Object
16 17 18 19 20 |
# File 'lib/gitlab/ci/config/interpolation/inputs/number_input.rb', line 16 def validate_type(value, default) return if value.is_a?(Numeric) error("#{default ? 'default' : 'provided'} value is not a number") end |