Sha256: 45c395935a0af7b0e5c8b34e8226bac7a06005a7ce7c610972b755f59b3f638c
Contents?: true
Size: 351 Bytes
Versions: 18
Compression:
Stored size: 351 Bytes
Contents
module Superstore module Types class FloatType < BaseType REGEX = /\A[-+]?\d+(\.\d+)?\Z/ def encode(float) raise ArgumentError.new("#{float.inspect} is not a Float") unless float.kind_of?(Float) float.to_s end def decode(str) return nil if str.empty? str.to_f end end end end
Version data entries
18 entries across 18 versions & 1 rubygems