Introduction

The Ruby Bridge Client is a library focused on making it simple to make API calls to the Platform API.

Prerequisites

In order to use the Ruby Bridge Client, you must first get in contact with our engineers to get your APP, URL, and KEY.

Setup

You first must set APP, URL, and KEY in BridgeClient::Secret. In this example, we are setting them in the config/environments/development.rb file so that we can use BridgeClient from anywhere in the app.

Rails.application.configure do
  module BridgeClient
    module Secret
      BridgeClient::Secret::APP = "APP_NAME"
      BridgeClient::Secret::URL = "HOST.com:3999"
      BridgeClient::Secret::KEY = "CLIENT_KEY"
    end
  end
end

Modules

The Ruby Bridge Client consists of 3 main modules:

BridgeClient::API

BridgeClient::API contains methods that wrap each endpoint of the Platform API directly (select, authorize, hipaa_log, etc). For more information, see the BridgeClient::API documentation.

BridgeClient::Query

BridgeClient::Query is a wrapper around BridgeClient::API, making it easier to chain pieces of the query similar to ActiveRecord. For example, .select, .from, .where. For more information, see the BridgeClient::Query documentation.

BridgeClient::ORM::Base

BridgeClient::ORM::Base is a module that should be inherited by modules/models in your Ruby/Rails application, giving your modules access to method such as find, update, and delete. For more information see the BridgeClient::ORM:Base documentation.