Class: Apipie::Validator::BooleanValidator
Instance Attribute Summary
#param_description
Class Method Summary
collapse
Instance Method Summary
collapse
#error, #expected_type, find, inherited, #initialize, #merge_with, #param_name, #params_ordered, #to_json, #to_s, #valid?
Class Method Details
.build(param_description, argument, options, block) ⇒ Object
334
335
336
337
338
|
# File 'lib/apipie/validator.rb', line 334
def self.build(param_description, argument, options, block)
if argument == :bool
self.new(param_description)
end
end
|
Instance Method Details
#description ⇒ Object
340
341
342
|
# File 'lib/apipie/validator.rb', line 340
def description
"Must be 'true' or 'false'"
end
|
#validate(value) ⇒ Object
330
331
332
|
# File 'lib/apipie/validator.rb', line 330
def validate(value)
%w[true false].include?(value.to_s)
end
|