Class: TSJSON::IntType

Inherits:
ScalarType show all
Defined in:
lib/types/int.rb

Instance Attribute Summary

Attributes inherited from ScalarType

#name

Instance Method Summary collapse

Methods inherited from ScalarType

#to_s

Methods inherited from Base

#compile, #index, #property, #valid?

Constructor Details

#initializeIntType

Returns a new instance of IntType.



5
6
7
# File 'lib/types/int.rb', line 5

def initialize
  super('Int')
end

Instance Method Details

#validate(value) ⇒ Object



9
10
11
12
13
# File 'lib/types/int.rb', line 9

def validate(value)
  super(value) unless value.is_a?(::Integer)

  true
end