Class: Bogeyman::Client
- Inherits:
-
Object
- Object
- Bogeyman::Client
- Defined in:
- lib/bogeyman/client.rb
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Client
constructor
A new instance of Client.
- #set_proxy(host, port = nil) ⇒ Object
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 = (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 |