Sha256: 28ea90e8d76c32b63b084bedd999654e8ea957c0e4acf2fb88a48b89d91ca359

Contents?: true

Size: 351 Bytes

Versions: 1

Compression:

Stored size: 351 Bytes

Contents

module Recess::Util
  extend self
  
  def constantize(camel_cased_word)
    names = camel_cased_word.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

1 entries across 1 versions & 1 rubygems

Version Path
recess-0.0.3 lib/recess/util.rb