diff --git a/README.md b/README.md index 728d35b..40e22de 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,51 @@ -# Blnk +# This gem is under development, don't use in production -TODO: Delete this and the text below, and describe your gem +# Blnk -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/blnk`. To experiment with that code, run `bin/console` for an interactive prompt. +Easy way to use the blnkfinance.com API in ruby ## Installation -TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org. - Install the gem and add to the application's Gemfile by executing: - $ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG + $ bundle add blnk If bundler is not being used to manage dependencies, install the gem by executing: - $ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG + $ gem install blnk ## Usage TODO: - [x] Create Ledger - [x] Find Ledger -- [ ] Create Balances -- [ ] Find Balances -- [ ] Create Transactions -- [ ] Find Transactions -- [ ] Do Search +- [x] List Ledgers +- [ ] Search Ledgers +- [x] Create Balances +- [x] Find Balance +- [ ] Search Balances +- [ ] Create Transaction +- [ ] Find Transaction +- [ ] Search Transactions -## Client connection +## Usage -``` +```ruby require 'blnk' +# client config + Blnk.address = '192.168.2.7:5001' Blnk.secret_token = 'your_strong_secret_key' Blnk.search_api_key = Blnk.secret_token -``` +# ledgers integration -## Ledger usage - -``` -ledger = Blnk::Ledger.new(name: 'foo bar').save ledger = Blnk::Ledger.create(name: 'foobar') - ledger = Blnk::Ledger.find 'ledger_id' ledgers = Blnk::Ledger.all +# search not implemented yet ledgers = Blnk::Ledger.search( q: 'USD', filter_by: 'balances > 1400', @@ -54,13 +53,13 @@ ledgers = Blnk::Ledger.search( page: 1, per_page: 50 ) -``` -## Creating a transaction -``` -``` +# Balance integrations +balance = Blnk::Balance.find 'balance_id' +balance = Blnk::Balance.create(ledger_id: 'ledger_id', currency: 'USD') +``` ## Development @@ -71,7 +70,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/blnk. +Bug reports and pull requests are welcome on GitHub at https://github.com/devton/blnk-ruby ## License