Sha256: 448145a87d324b985b9e8ad0f58310f20aa125c64bd42be88b67d169e9f73510
Contents?: true
Size: 635 Bytes
Versions: 11
Compression:
Stored size: 635 Bytes
Contents
module Restspec::Schema::Types class IntegerType < BasicType # Generates a random number. # # @param attribute [Restspec::Schema::Attribute] the atribute of the schema. # # @return [Fixnum] A random number. def example_for(attribute) Faker::Number.digit.to_i end # Validates if the value is an integer (Fixnum). # # @param attribute [Restspec::Schema::Attribute] the atribute of the schema. # @param value [Object] the value of the attribute. # # @return [true, false] If the value is an integer. def valid?(attribute, value) value.is_a?(Fixnum) end end end
Version data entries
11 entries across 11 versions & 1 rubygems