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