Class: ClientManager
- Inherits:
-
Object
- Object
- ClientManager
- Defined in:
- lib/client_manager.rb
Instance Attribute Summary collapse
-
#clients ⇒ Object
Returns the value of attribute clients.
Instance Method Summary collapse
- #add_client(client) ⇒ Object
-
#initialize ⇒ ClientManager
constructor
A new instance of ClientManager.
- #new_client(name) ⇒ Object
Constructor Details
#initialize ⇒ ClientManager
Returns a new instance of ClientManager.
6 7 8 |
# File 'lib/client_manager.rb', line 6 def initialize @clients = {} end |
Instance Attribute Details
#clients ⇒ Object
Returns the value of attribute clients.
4 5 6 |
# File 'lib/client_manager.rb', line 4 def clients @clients end |
Instance Method Details
#add_client(client) ⇒ Object
10 11 12 |
# File 'lib/client_manager.rb', line 10 def add_client(client) @clients[client.name] = client end |
#new_client(name) ⇒ Object
14 15 16 17 |
# File 'lib/client_manager.rb', line 14 def new_client(name) new_client = Client.new(name) add_client(new_client) end |