module HabitatSupervisor::Connection
Public Instance Methods
get(path, options = {})
click to toggle source
# File lib/habitat_supervisor/connection.rb, line 6 def get(path, options = {}) req = Net::HTTP::Get.new(path, options) response = http.request(req) JSON.parse(response.body) end
http()
click to toggle source
# File lib/habitat_supervisor/connection.rb, line 16 def http @http ||= Net::HTTP.new(url.host, url.port) end
url()
click to toggle source
# File lib/habitat_supervisor/connection.rb, line 12 def url @url ||= URI.parse(api_endpoint) end