method
cast_value
v5.2.3 -
Show latest stable
- Class:
ActiveModel::Type::Float
cast_value(value)private
No documentation available.
# File activemodel/lib/active_model/type/float.rb, line 25
def cast_value(value)
case value
when ::Float then value
when "Infinity" then ::Float::INFINITY
when "-Infinity" then -::Float::INFINITY
when "NaN" then ::Float::NAN
else value.to_f
end
end