Sha256: 580ecc7a64818cdf7ed1a9cf17023513e9d635e1ef0caf6dcc87e7b8c1bb44d9
Contents?: true
Size: 366 Bytes
Versions: 13
Compression:
Stored size: 366 Bytes
Contents
module ApiResource module Typecast module IntegerTypecaster def self.from_api(value) return value.to_i if value.respond_to?(:to_i) # Special case so that true typecasts to 1 return 1 if value.class == TrueClass return value.to_s.to_i end def self.to_api(value) value end end end end
Version data entries
13 entries across 13 versions & 1 rubygems