class NDBC::Connection

Public Class Methods

new() click to toggle source
# File lib/ndbc/connection.rb, line 6
def initialize
  @client = Faraday.new do |faraday|
    faraday.adapter  Faraday.default_adapter
  end
end

Public Instance Methods

get(path) click to toggle source
# File lib/ndbc/connection.rb, line 12
def get(path)
  response = @client.get(path)
  case response.status
  when 200
    response.body
  when 404
    raise NDBC::NotFound
  end
end