Sha256: 3cee5d209bc4189052881ba46a33376c4864cf9918885ed97de80dbd83b49210
Contents?: true
Size: 380 Bytes
Versions: 13
Compression:
Stored size: 380 Bytes
Contents
module Superstore module Types class IntegerType < BaseType REGEX = /\A[-+]?\d+\Z/ def encode(int) raise ArgumentError.new("#{int.inspect} is not an Integer.") unless int.kind_of?(Integer) int end def decode(str) str.to_i unless str.empty? end def typecast(value) value.to_i end end end end
Version data entries
13 entries across 13 versions & 1 rubygems