Sha256: 074e9365ffcd99366c1f18179f7b2fc6d2a4f634000a6cd2e7d9b351198f1052
Contents?: true
Size: 709 Bytes
Versions: 8
Compression:
Stored size: 709 Bytes
Contents
# From ActiveSupport class String if Module.method(:const_get).arity == 1 def constantize names = self.split('::') names.shift if names.empty? || names.first.empty? constant = Object names.each do |name| constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name) end constant end else def constantize #:nodoc: names = self.split('::') names.shift if names.empty? || names.first.empty? constant = Object names.each do |name| constant = constant.const_defined?(name, false) ? constant.const_get(name) : constant.const_missing(name) end constant end end end
Version data entries
8 entries across 8 versions & 1 rubygems