Sha256: 4610da24c0c7af38bb819d68cd8bb759860ee2c0e7bc818663244764341b50ec
Contents?: true
Size: 461 Bytes
Versions: 13
Compression:
Stored size: 461 Bytes
Contents
class String # Constatntize is often provided by ActiveSupport, but ActiveSupport is not a dependency of Split. unless method_defined?(:constantize) 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 end end
Version data entries
13 entries across 13 versions & 1 rubygems