Class: RubyPitaya::InstanceHolder
- Inherits:
-
Object
- Object
- RubyPitaya::InstanceHolder
- Defined in:
- lib/rubypitaya/core/instance_holder.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #add(key, instance) ⇒ Object
-
#initialize ⇒ InstanceHolder
constructor
A new instance of InstanceHolder.
Constructor Details
#initialize ⇒ InstanceHolder
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 |