Sha256: c1e5cd338bb26faa189a2f7339a5a82dcef63c079f21251d27bdba220b98c3b8
Contents?: true
Size: 629 Bytes
Versions: 19
Compression:
Stored size: 629 Bytes
Contents
# This is here to remove DataObject's dependency on Extlib. module DataObjects # @param name<String> The name of the constant to get, e.g. "Merb::Router". # # @return <Object> The constant corresponding to the name. def self.full_const_get(name) list = name.split("::") list.shift if list.first.nil? || list.first.strip.empty? obj = ::Object list.each do |x| # This is required because const_get tries to look for constants in the # ancestor chain, but we only want constants that are HERE obj = obj.const_defined?(x) ? obj.const_get(x) : obj.const_missing(x) end obj end end
Version data entries
19 entries across 19 versions & 1 rubygems