0.0
No release in over a year
Instruments library
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

= 0.1.0
 Project Readme

Hws::Instruments

This package acts as an adapter to the hws-connectors package by storing the state information corresponding to connectors. This package introduces 2 entities: InstrumentConfig and Instrument:

InstrumentConfig:

An instrument config encapsulates the state information required to operate on a hws-connector. (classes extending Hws::Connectors in hws-connectors. e.g.: Hypto::Payout or Hypto::VirtualAccount)

Instrument:

An instrument is an instance of an instrument config mapped to an entity in the connector.

e.g, A VirtualAcount instrument created from instrumentConfig with an account number HYPTOUAT12324283141087 maps to an actual virtual account created in hypto's end and any operation to be performed on a hypto virtual account can be performed on the instrument with implictly acts on the mapped resource with the help of connector APIs.

Installation

Add this line to your application's Gemfile:

gem 'hws-instruments'

And then execute:

$ bundle

Or install it yourself as:

$ gem install hws-instruments

Setup

Instrument configs can be initialized with the help of rake tasks under the namespace hws-instruments.

Available rake tasks can be listed using the command: rake -T -A. The result will contain tasks as follows

...
rake hws-instruments:hypto:payouts[api_token]          # Initializes a Hypto payouts instrument config in DB
rake hws-instruments:hypto:virtual_account[api_token]  # Initializes a Hypto virtual accounts instrument config in DB
...

Example, The rake task to initialize hypto payouts instrument can be triggered as follows:

rake hws-instruments:hypto:payouts["<api_token>"]

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/hwslabs/hws-instruments. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.