Class: ContainerConfig::Coercer::Float
- Defined in:
- lib/container_config/coercer/float.rb
Overview
Float type coercer
Instance Method Summary collapse
-
#coerce(value) ⇒ Float
Coerces the given value into a float.
- #name ⇒ Object
- #type ⇒ Object
Instance Method Details
#coerce(value) ⇒ Float
Coerces the given value into a float
26 27 28 29 30 |
# File 'lib/container_config/coercer/float.rb', line 26 def coerce(value) return 0.0 unless value.respond_to?(:to_f) value.to_f end |
#name ⇒ Object
10 11 12 |
# File 'lib/container_config/coercer/float.rb', line 10 def name "Float" end |
#type ⇒ Object
15 16 17 |
# File 'lib/container_config/coercer/float.rb', line 15 def type :float end |