Class: Ci::Inputs::StringInput
Instance Attribute Summary
Attributes inherited from BaseInput
#errors, #name, #spec
Class Method Summary
collapse
Instance Method Summary
collapse
extended, extensions, included, method_added, override, prepended, queue_verification, verify!
Methods inherited from BaseInput
#actual_value, #default, #default_value_present?, #description, #initialize, #options, #regex, #required?, #rules, #type, #validate_param!
Class Method Details
.matches?(spec) ⇒ Boolean
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/ci/inputs/string_input.rb', line 8
def self.matches?(spec)
spec.nil? || super || (spec.is_a?(Hash) && !spec.key?(:type))
end
|
.type_name ⇒ Object
20
21
22
|
# File 'lib/ci/inputs/string_input.rb', line 20
def self.type_name
'string'
end
|
Instance Method Details
#validate_options(value, all_params = {}) ⇒ Object
31
32
33
34
35
36
37
|
# File 'lib/ci/inputs/string_input.rb', line 31
def validate_options(value, all_params = {})
allowed_options = rules ? resolved_options(all_params) : options
return unless allowed_options && value
return if allowed_options.map(&:to_s).include?(value)
error("`#{value}` cannot be used because it is not in the list of allowed options")
end
|
#validate_type(value, _default) ⇒ Object
25
26
27
28
|
# File 'lib/ci/inputs/string_input.rb', line 25
def validate_type(value, _default)
end
|