safe_constantize

in lib/elastic_apm/util/inflector.rb [98:106]


      def safe_constantize(camel_cased_word)
        constantize(camel_cased_word)
      rescue NameError => e
        raise if e.name && !(camel_cased_word.to_s.split("::").include?(e.name.to_s) ||
                             e.name.to_s == camel_cased_word.to_s)
      rescue ArgumentError => e
        raise unless /not missing constant 
      end