Method: Toaster::ToasterAppClient#initialize

Defined in:
lib/toaster/api.rb

#initialize(host, port = 8385) ⇒ ToasterAppClient

Returns a new instance of ToasterAppClient.



421
422
423
424
425
426
427
# File 'lib/toaster/api.rb', line 421

def initialize(host, port=8385)
  @host = host.include?(":") ? host.gsub(/([^:]+):.*/, '\1') : host
  @port = host.include?(":") ? host.gsub(/([^:]+):(.+)/, '\2') : port
  @port = @port.to_i
  super(@host, "/", @port)
  self.timeout = 60*60 # timeout of 1h for RPC calls
end