Class: Restspec::Schema::Types::IntegerType

Inherits:
BasicType
  • Object
show all
Defined in:
lib/restspec/schema/types/integer_type.rb

Instance Method Summary collapse

Methods inherited from BasicType

#initialize, #of, #totally_valid?, #|

Constructor Details

This class inherits a constructor from Restspec::Schema::Types::BasicType

Instance Method Details

#example_for(attribute) ⇒ Object



3
4
5
# File 'lib/restspec/schema/types/integer_type.rb', line 3

def example_for(attribute)
  Faker::Number.digit
end

#valid?(attribute, value) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/restspec/schema/types/integer_type.rb', line 7

def valid?(attribute, value)
  value.is_a?(Fixnum)
end