Module: Jackal::Utils::Constants
- Included in:
- Jackal::Utils
- Defined in:
- lib/jackal/utils/constants.rb
Instance Method Summary collapse
-
#constantize(string) ⇒ Class
Provide constant defined by string.
Instance Method Details
#constantize(string) ⇒ Class
Provide constant defined by string
11 12 13 14 15 |
# File 'lib/jackal/utils/constants.rb', line 11 def constantize(string) klass = string.to_s.split('::').inject(Object) do |memo, name| memo.const_get(name) end end |