Class: Virtus::Attributes::Float
- Defined in:
- lib/virtus/attributes/float.rb
Constant Summary
Constants inherited from Attribute
Attribute::DEFAULT_ACCESSOR, Attribute::OPTIONS
Instance Attribute Summary
Attributes inherited from Attribute
#instance_variable_name, #model, #name, #options, #reader_visibility, #writer_visibility
Instance Method Summary collapse
-
#typecast_to_primitive(value, model = nil) ⇒ Float
private
Typecast a value to a Float.
Methods included from Typecast::Numeric
Methods inherited from Attribute
#_create_reader, #_create_writer, accept_options, accepted_options, #complex?, descendants, #get, #get!, inherited, #initialize, options, #primitive?, #set, #set!, #typecast
Constructor Details
This class inherits a constructor from Virtus::Attributes::Attribute
Instance Method Details
#typecast_to_primitive(value, model = nil) ⇒ Float
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Typecast a value to a Float
15 16 17 |
# File 'lib/virtus/attributes/float.rb', line 15 def typecast_to_primitive(value, model = nil) typecast_to_numeric(value, :to_f) end |