Class: Neows::Attributes::SanitizedInteger

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

Instance Method Summary collapse

Instance Method Details

#coerce(value) ⇒ Integer

Coerces a string with commas to an Integer

Parameters:

  • value (String)

Returns:

  • (Integer)


8
9
10
# File 'lib/neows/attributes.rb', line 8

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