Class: Bogeyman::Client

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

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Client

Returns a new instance of Client.



5
6
7
8
9
10
11
# File 'lib/bogeyman/client.rb', line 5

def initialize params={}
  host = params.delete(:host) || 'localhost'
  port = params.delete(:port) || 31313
  @cookies = (params.delete(:cookies) || []).map{ |c| Cookie.new(c) }
  @server = "http://#{host}:#{port}"
  @params = params
end

Instance Method Details

#set_proxy(host, port = nil) ⇒ Object



19
20
21
# File 'lib/bogeyman/client.rb', line 19

def set_proxy host, port=nil
  @params[:proxy] = port ? "#{host}:#{port}" : host
end