Class: WebClient::Base

Inherits:
Object
  • Object
show all
Includes:
Net
Defined in:
lib/web_client/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Base

Returns a new instance of Base.



7
8
9
10
11
12
13
14
15
16
# File 'lib/web_client/base.rb', line 7

def initialize(*args)
  if args.first.is_a? Hash
    host = args[0]['host'] || args[0][:host]
    port = args[0]['port'] || args[0][:port]
  else
    host = args[0]
    port = args[1]
  end
  @http = HTTP.new(host, port)
end

Instance Attribute Details

#httpObject (readonly)

Returns the value of attribute http.



5
6
7
# File 'lib/web_client/base.rb', line 5

def http
  @http
end