Class: Neows::Attributes::SanitizedFloat

Inherits:
Virtus::Attribute
  • Object
show all
Defined in:
lib/neows/attributes.rb

Instance Method Summary collapse

Instance Method Details

#coerce(value) ⇒ Float

Coerces a string with commas to a Float

Parameters:

  • value (String)

Returns:

  • (Float)


18
19
20
# File 'lib/neows/attributes.rb', line 18

def coerce(value)
  value.delete(',').to_f
end