Class: Casino::Lobby
- Inherits:
-
Object
- Object
- Casino::Lobby
- Defined in:
- lib/casino/lobby.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
Returns the value of attribute collection.
Instance Method Summary collapse
- #add_registry(object) ⇒ Object
-
#initialize(klass) ⇒ Lobby
constructor
A new instance of Lobby.
- #registry ⇒ Object
Constructor Details
#initialize(klass) ⇒ Lobby
Returns a new instance of Lobby.
5 6 7 |
# File 'lib/casino/lobby.rb', line 5 def initialize(klass) self.collection = klass end |
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection.
3 4 5 |
# File 'lib/casino/lobby.rb', line 3 def collection @collection end |
Instance Method Details
#add_registry(object) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/casino/lobby.rb', line 13 def add_registry(object) key = object.class.name.downcase.split("::").last.to_sym registry[key] ||= Array.new registry[key] << object registry[key] = registry[key].uniq end |
#registry ⇒ Object
9 10 11 |
# File 'lib/casino/lobby.rb', line 9 def registry @registry ||= Hash.new end |