class Apipie::Validator::NumberValidator
Public Class Methods
build(param_description, argument, options, block)
click to toggle source
# File lib/apipie/validator.rb, line 382 def self.build(param_description, argument, options, block) if argument == :number self.new(param_description) end end
validate(value)
click to toggle source
# File lib/apipie/validator.rb, line 392 def self.validate(value) value.to_s =~ /\A(0|[1-9]\d*)\Z$/ end
Public Instance Methods
description()
click to toggle source
# File lib/apipie/validator.rb, line 388 def description "Must be a number." end
validate(value)
click to toggle source
# File lib/apipie/validator.rb, line 378 def validate(value) self.class.validate(value) end