instance method
cast_value
Ruby on Rails 7.2.3
Since v7.1.6 PrivateSignature
cast_value(value)
No documentation comment.
Parameters
-
valuereq
Source
# File activemodel/lib/active_model/type/float.rb, line 53
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
Defined in activemodel/lib/active_model/type/float.rb line 53
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Type::Float