Sha256: a169f281504da8336fb490df9af2c8b57a03afbadd68b0a7e8b5fee5935e431c
Contents?: true
Size: 463 Bytes
Versions: 8
Compression:
Stored size: 463 Bytes
Contents
class RestModel module Serialization class Integer def self.serialize(value) case value when ::String if value =~ /^\d+$/ value.to_i else raise end else Integer(value) end rescue raise SerializationError, "value '#{value}' is not an integer" end def self.desserialize(value) serialize(value) end end end end
Version data entries
8 entries across 8 versions & 1 rubygems