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



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

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

Instance Method Details

#descriptionObject



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

def description
  "Must be an integer"
end

#json_schemaObject



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

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