# File lib/apipie/validator.rb, line 249 def self.build(param_description, argument, options, block) if argument == :number self.new(param_description) end end
# File lib/apipie/validator.rb, line 263 def self.validate(value) value.to_s =~ %r\A(0|[1-9]\d*)\Z$/ end
# File lib/apipie/validator.rb, line 259 def description "Has to be a number." end
# File lib/apipie/validator.rb, line 255 def error "Parameter #{param_name} expecting to be a number, got: #{@error_value}" end
# File lib/apipie/validator.rb, line 245 def validate(value) self.class.validate(value) end