Class: Apipie::Params::Descriptor::Number
- Inherits:
-
Regexp
- Object
- Base
- JsonSchema
- Regexp
- Apipie::Params::Descriptor::Number
- Defined in:
- lib/apipie/params/descriptor.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Regexp
Methods inherited from JsonSchema
inherited, #json_schema, #validate!
Methods inherited from Base
find, inherited, #initialize, #invalid_param_error, #to_json
Constructor Details
This class inherits a constructor from Apipie::Params::Descriptor::Regexp
Class Method Details
.build(argument, options, block) ⇒ Object
307 308 309 310 311 |
# File 'lib/apipie/params/descriptor.rb', line 307 def self.build(argument, , block) if argument == :number self.new(self.pattern, ) end end |
.pattern ⇒ Object
317 318 319 |
# File 'lib/apipie/params/descriptor.rb', line 317 def self.pattern /\A(0|[1-9]\d*)\Z$/ end |
Instance Method Details
#description ⇒ Object
313 314 315 |
# File 'lib/apipie/params/descriptor.rb', line 313 def description "Must be a number." end |