Class: Apipie::Params::Descriptor::Integer

Inherits:
JsonSchema show all
Defined in:
lib/apipie/params/descriptor.rb

Overview

validate arguments type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from JsonSchema

inherited, #validate!

Methods inherited from Base

find, inherited, #initialize, #invalid_param_error, #to_json

Constructor Details

This class inherits a constructor from Apipie::Params::Descriptor::Base

Class Method Details

.build(type, options, block) ⇒ Object



113
114
115
# File 'lib/apipie/params/descriptor.rb', line 113

def self.build(type, options, block)
  self.new(options) if type == ::Integer
end

Instance Method Details

#descriptionObject



117
118
119
# File 'lib/apipie/params/descriptor.rb', line 117

def description
  "Must be an integer"
end

#json_schemaObject



121
122
123
# File 'lib/apipie/params/descriptor.rb', line 121

def json_schema
  super.merge('type' => 'integer')
end