Class: RubyPitaya::InstanceHolder

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypitaya/core/instance_holder.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rubypitaya-3.12.1/lib/rubypitaya/core/instance_holder.rb

Instance Method Summary collapse

Constructor Details

#initializeInstanceHolder

Returns a new instance of InstanceHolder.



5
6
7
# File 'lib/rubypitaya/core/instance_holder.rb', line 5

def initialize
  @instances = {}
end

Instance Method Details

#[](key) ⇒ Object



13
14
15
# File 'lib/rubypitaya/core/instance_holder.rb', line 13

def [](key)
  @instances[key]
end

#add(key, instance) ⇒ Object



9
10
11
# File 'lib/rubypitaya/core/instance_holder.rb', line 9

def add(key, instance)
  @instances[key] = instance
end