class Aliyun::Log::Record::TypeCasting::BigDecimalType
Public Instance Methods
cast(value)
click to toggle source
# File lib/aliyun/log/record/type_casting.rb, line 142 def cast(value) if value == true 1 elsif value == false 0 elsif value.is_a?(Symbol) value.to_s.to_d elsif value.is_a?(String) && value.blank? nil elsif value.is_a?(Float) && !value.finite? nil elsif !value.respond_to?(:to_d) nil else value.to_d end end