Method: PulseMeter::Mixins::Utils#constantize
- Defined in:
- lib/pulse_meter/mixins/utils.rb
#constantize(const_name) ⇒ Class, NilClass
Tries to find a class with the name specified in the argument string
11 12 13 14 15 16 |
# File 'lib/pulse_meter/mixins/utils.rb', line 11 def constantize(const_name) return unless const_name.respond_to?(:to_s) const_name.to_s.split('::').reduce(Module, :const_get) rescue NameError nil end |