# File lib/apipie/validator.rb, line 173 def description "" end
# File lib/apipie/validator.rb, line 169 def error "Parameter #{param_name} has bad value (\"#{@error_value}\"). #{@help}" end
# File lib/apipie/validator.rb, line 161 def validate(value) (@help = @proc.call(value)) === true end
# File lib/apipie/validator.rb, line 165 def self.build(param_description, argument, options, proc) self.new(param_description, argument) if argument.is_a?(Proc) && argument.arity == 1 end
# File lib/apipie/validator.rb, line 156 def initialize(param_description, argument) super(param_description) @proc = argument end