Sha256: a4aeb0b1a622be974f813cf02c53e819a0d7cba52f078a1728ea44e9d306e4f2

Contents?: true

Size: 332 Bytes

Versions: 2

Compression:

Stored size: 332 Bytes

Contents

class String
  # Taken from ActiveSupport::Inflector
  def constantize
    names = 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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
app_store-0.1.2 lib/app_store/helpers/string.rb
app_store-0.1.0 lib/app_store/helpers/string.rb