Sha256: 8d5eba7084e879faacebeb268bbe82a493e93faff7ee5f4a82baa686e75ba9a5

Contents?: true

Size: 436 Bytes

Versions: 2

Compression:

Stored size: 436 Bytes

Contents

begin
  require 'active_support/core_ext/string/inflections'
rescue LoadError
  class String
    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 if !"".respond_to?(:constantize)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
upperkut-0.1.2 lib/upperkut/core_ext.rb
upperkut-0.1.0 lib/upperkut/core_ext.rb