Class: Yap::World::AddonHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/yap/world.rb

Instance Method Summary collapse

Constructor Details

#initialize(world) ⇒ AddonHash

Returns a new instance of AddonHash.



101
102
103
# File 'lib/yap/world.rb', line 101

def initialize(world)
  @world = world
end

Instance Method Details

#[](key) ⇒ Object



105
106
107
108
109
110
111
# File 'lib/yap/world.rb', line 105

def [](key)
  addon = super
  unless @world.addon_initialized?(addon)
    @world.initialize_addon(addon)
  end
  addon
end