Sha256: f68e0d84a15a03ccedee4f021836876174933e9fe668bf440a4c6273ba6953c4

Contents?: true

Size: 679 Bytes

Versions: 4

Compression:

Stored size: 679 Bytes

Contents

module Conject
  class ObjectContext
    def has_config?(name)
      @object_configs.has_key?(name.to_sym)
    end
    def directly_has?(name)
      @cache.has_key?(name.to_sym) or has_config?(name.to_sym)
    end
    def get(name)
      name = name.to_sym
      return @cache[name] if @cache.has_key?(name)
      
      if !has_config?(name) and parent_context and parent_context.has?(name)
        return parent_context.get(name)
      else
        object = object_factory.construct_new(name,self)
        object.instance_variable_set(:@_conject_contextual_name, name.to_s)
        @cache[name] = object unless no_cache?(name)
        return object
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gamebox-0.5.5 lib/gamebox/lib/conject_ext.rb
gamebox-0.5.4 lib/gamebox/lib/conject_ext.rb
gamebox-0.5.2 lib/gamebox/lib/conject_ext.rb
gamebox-0.5.1 lib/gamebox/lib/conject_ext.rb