Class: Dbee::ConstantResolver
- Inherits:
-
Object
- Object
- Dbee::ConstantResolver
- Defined in:
- lib/dbee/constant_resolver.rb
Overview
This class is responsible for turning strings and symbols into constants. It does not deal with inflection, simply just constant resolution.
Instance Method Summary collapse
-
#constantize(value) ⇒ Object
Only use Module constant resolution if a string or symbol was passed in.
Instance Method Details
#constantize(value) ⇒ Object
Only use Module constant resolution if a string or symbol was passed in. Any other type is defined as an acceptable constant and is simply returned.
16 17 18 |
# File 'lib/dbee/constant_resolver.rb', line 16 def constantize(value) value.is_a?(String) || value.is_a?(Symbol) ? object_constant(value) : value end |