Method: Transmission::Connection.init
- Defined in:
- lib/transmission-client/em-connection.rb
.init(host, port, username = nil, password = nil) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/transmission-client/em-connection.rb', line 4 def init(host, port, username = nil, password = nil) @host = host @port = port @header = username.nil? ? {} : {'authorization' => [username, password]} uri = URI.parse("http://#{@host}:#{@port}/transmission/rpc") @conn = EventMachine::HttpRequest.new(uri) end |