lib/pulse_meter/mixins/utils.rb
# Tries to find a class with the name specified in the argument string
# @param const_name [String] class name
# @return [Class] if given class definde
# @return [NilClass] if given class is not defined
Tries to find a class with the name specified in the argument string
Tries to find a class with the name specified in the argument string
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
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
Tries to find a class with the name specified in the argument string
Tries to find a class with the name specified in the argument string
if given class definde
if given class definde
Class
if given class is not defined
if given class is not defined
NilClass
const_name
None