Class: IknowParams::Serializer::Numeric
- Inherits:
-
IknowParams::Serializer
- Object
- IknowParams::Serializer
- IknowParams::Serializer::Numeric
- Defined in:
- lib/iknow_params/serializer.rb
Instance Attribute Summary
Attributes inherited from IknowParams::Serializer
Instance Method Summary collapse
-
#initialize ⇒ Numeric
constructor
A new instance of Numeric.
- #load(str) ⇒ Object
Methods inherited from IknowParams::Serializer
#dump, for, for!, json_value?, #matches_type!, #matches_type?, singleton
Constructor Details
#initialize ⇒ Numeric
Returns a new instance of Numeric.
159 160 161 |
# File 'lib/iknow_params/serializer.rb', line 159 def initialize super(::Numeric) end |
Instance Method Details
#load(str) ⇒ Object
163 164 165 166 167 |
# File 'lib/iknow_params/serializer.rb', line 163 def load(str) Float(str) rescue TypeError, ArgumentError => _e raise LoadError.new("Invalid type for conversion to Numeric") end |