Class: ClientManager

Inherits:
Object
  • Object
show all
Defined in:
lib/client_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClientManager

Returns a new instance of ClientManager.



6
7
8
# File 'lib/client_manager.rb', line 6

def initialize
  @clients = {} 
end

Instance Attribute Details

#clientsObject

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