Class: HasSetting::Formatters::FloatFormatter
- Inherits:
-
NilSafeFormatter
- Object
- NilSafeFormatter
- HasSetting::Formatters::FloatFormatter
- Defined in:
- lib/has_setting/formatters.rb
Overview
Formatter for float values Throws ArgumentError if value can not be converted
Instance Method Summary collapse
Methods inherited from NilSafeFormatter
Instance Method Details
#safe_to_s(value) ⇒ Object
135 136 137 |
# File 'lib/has_setting/formatters.rb', line 135 def safe_to_s(value) Float(value).to_s end |
#safe_to_type(value) ⇒ Object
132 133 134 |
# File 'lib/has_setting/formatters.rb', line 132 def safe_to_type(value) Float(value) end |