Module: HabitatSupervisor::Connection
- Included in:
- Client
- Defined in:
- lib/habitat_supervisor/connection.rb
Instance Method Summary collapse
Instance Method Details
#get(path, options = {}) ⇒ Object
6 7 8 9 10 |
# File 'lib/habitat_supervisor/connection.rb', line 6 def get(path, = {}) req = Net::HTTP::Get.new(path, ) response = http.request(req) JSON.parse(response.body) end |
#http ⇒ Object
16 17 18 |
# File 'lib/habitat_supervisor/connection.rb', line 16 def http @http ||= Net::HTTP.new(url.host, url.port) end |
#url ⇒ Object
12 13 14 |
# File 'lib/habitat_supervisor/connection.rb', line 12 def url @url ||= URI.parse(api_endpoint) end |