Class: Katello::Apipie::Validators::BooleanValidator
- Inherits:
-
Apipie::Validator::BaseValidator
- Object
- Apipie::Validator::BaseValidator
- Katello::Apipie::Validators::BooleanValidator
- Defined in:
- lib/katello/apipie/validators.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.build(param_description, argument, _options, _block) ⇒ Object
78 79 80 81 82 |
# File 'lib/katello/apipie/validators.rb', line 78 def self.build(param_description, argument, , _block) if argument == :bool self.new(param_description) end end |
Instance Method Details
#description ⇒ Object
88 89 90 |
# File 'lib/katello/apipie/validators.rb', line 88 def description "boolean" end |
#error ⇒ Object
84 85 86 |
# File 'lib/katello/apipie/validators.rb', line 84 def error "Parameter #{param_name} expecting to be a boolean value, got: #{@error_value}" end |
#validate(value) ⇒ Object
74 75 76 |
# File 'lib/katello/apipie/validators.rb', line 74 def validate(value) %w(true false True False).include?(value.to_s) end |