Class: Gitlab::Ci::Config::Interpolation::Inputs::StringInput
- Inherits:
-
BaseInput
- Object
- BaseInput
- Gitlab::Ci::Config::Interpolation::Inputs::StringInput
- Defined in:
- lib/gitlab/ci/config/interpolation/inputs/string_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 inherited from BaseInput
#initialize, #to_hash, #valid?
Constructor Details
This class inherits a constructor from Gitlab::Ci::Config::Interpolation::Inputs::BaseInput
Class Method Details
.matches?(spec) ⇒ Boolean
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/gitlab/ci/config/interpolation/inputs/string_input.rb', line 9 def self.matches?(spec) # The input spec can be `nil` when using a minimal specification # and also when `type` is not specified. # # ```yaml # spec: # inputs: # foo: # ``` spec.nil? || (spec.is_a?(Hash) && [nil, type_name].include?(spec[:type])) end |
.type_name ⇒ Object
21 22 23 |
# File 'lib/gitlab/ci/config/interpolation/inputs/string_input.rb', line 21 def self.type_name 'string' end |
Instance Method Details
#valid_value?(value) ⇒ Boolean
25 26 27 |
# File 'lib/gitlab/ci/config/interpolation/inputs/string_input.rb', line 25 def valid_value?(value) value.nil? || value.is_a?(String) end |