module Que::Utils::Constantization

Public Instance Methods

constantize(string) click to toggle source
# File lib/que/utils/constantization.rb, line 6
def constantize(string)
  Que.assert String, string

  if string.respond_to?(:constantize)
    string.constantize
  else
    names = string.split('::')
    names.reject!(&:empty?)
    names.inject(Object, &:const_get)
  end
end