Class: PXMyPortal::HTTPClient

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/pxmyportal/http_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(debug: false, logger:) ⇒ HTTPClient

Returns a new instance of HTTPClient.



21
22
23
24
25
26
27
# File 'lib/pxmyportal/http_client.rb', line 21

def initialize(debug: false, logger:)
  @http = Net::HTTP.new(PXMyPortal::HOST, Net::HTTP.https_default_port)
  @http.use_ssl = true
  @http.set_debug_output($stderr) if debug

  @cookie = PXMyPortal::Cookie.new(logger:)
end

Instance Method Details

#startObject



29
30
31
# File 'lib/pxmyportal/http_client.rb', line 29

def start
  @http.started? or @http.start
end