Class: ContainerConfig::Coercer::Symbol

Inherits:
Base
  • Object
show all
Defined in:
lib/container_config/coercer/symbol.rb

Overview

Symbol type coercer

Instance Method Summary collapse

Instance Method Details

#coerce(value) ⇒ Symbol

Coerces the given value into a symbol

Parameters:

  • value (Object)

    given value

Returns:



26
27
28
29
30
# File 'lib/container_config/coercer/symbol.rb', line 26

def coerce(value)
  return if value.nil?

  value.to_s.to_sym
end

#nameObject

See Also:



10
11
12
# File 'lib/container_config/coercer/symbol.rb', line 10

def name
  "Symbol"
end

#typeObject

See Also:



15
16
17
# File 'lib/container_config/coercer/symbol.rb', line 15

def type
  :symbol
end