class Apipie::Validator::BooleanValidator
Public Class Methods
build(param_description, argument, options, block)
click to toggle source
# File lib/apipie/validator.rb, line 403 def self.build(param_description, argument, options, block) if argument == :bool self.new(param_description) end end
Public Instance Methods
description()
click to toggle source
# File lib/apipie/validator.rb, line 413 def description "Must be 'true' or 'false'" end
expected_type()
click to toggle source
# File lib/apipie/validator.rb, line 409 def expected_type 'boolean' end
validate(value)
click to toggle source
# File lib/apipie/validator.rb, line 399 def validate(value) %w[true false].include?(value.to_s) end