Class: Sonic::Client

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

Instance Method Summary collapse

Constructor Details

#initialize(host, port, password = nil) ⇒ Client

Returns a new instance of Client.



3
4
5
6
7
# File 'lib/sonic/client.rb', line 3

def initialize(host, port, password = nil)
  @host = host
  @port = port
  @password = password
end

Instance Method Details

#channel(type) ⇒ Object



9
10
11
# File 'lib/sonic/client.rb', line 9

def channel(type)
  channel_class(type).new(Connection.connect(@host, @port, type, @password))
end