Class: Funky::Connection::Base Private

Inherits:
Object
  • Object
show all
Defined in:
lib/funky/connections/base.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Direct Known Subclasses

API

Class Method Summary collapse

Class Method Details

.get_http_request(uri) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/funky/connections/base.rb', line 8

def self.get_http_request(uri)
  Net::HTTP::Get.new(uri.request_uri)
end

.response_for(http_request, uri) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



12
13
14
15
16
17
18
19
# File 'lib/funky/connections/base.rb', line 12

def self.response_for(http_request, uri)
  response = Net::HTTP.start(uri.host, 443, use_ssl: true) do |http|
    http.request http_request
  end
  response
rescue SocketError => e
  raise ConnectionError, e.message
end