Sha256: 03bafa17a673787ca1bdacdd2cb46c4e957576aa8026b5a96698ee65b303c760
Contents?: true
Size: 361 Bytes
Versions: 26
Compression:
Stored size: 361 Bytes
Contents
module ApiResource module Typecast module FloatTypecaster def self.from_api(value) return value.to_f if value.respond_to?(:to_f) # Special case for true to return 1.0 return 1.0 if value.class == TrueClass return value.to_s.to_f end def self.to_api(value) value end end end end
Version data entries
26 entries across 26 versions & 1 rubygems