require "banks_api-bankname"
user_account = BanksApi::UserAccount.new(
"bankname",
credential_hash
)
A user's account in a bank may have access to multiple bank accounts.
bank_accounts = user_account.bank_accounts
puts bank_accounts.first.inspect
#<BanksApi::BankName::BankAccount
id: "1234567890",
description: "...",
balance: #<Money fractional:987654 currency:JPY>
>
transactions = bank_accounts.first.transactions(
from: Date.today.prev_month,
to: Date.today
)
puts transactions.first.inspect
#<BanksApi::BankName::Transaction
date: #<Date: 2018-09-25 ((2458387j,0s,0n),+0s,2299161j)>,
description: "a description of the transaction",
amount: #<Money fractional:200 currency:JPY>
>
Specific bank classes (eg. ShinseiBank
) inherit from this. (Maybe using
duck-typing is enough?)
This represents a user account in a specific bank, with its credentials.
attr_accessor :bank # Class? Symbol?
attr_accessor :credentials # Hash? CredentialSet?
has_many :bank_accounts, class_name: "BankAccount"
A bank account that has a balance and a list of transactions. (There may be multiple bank accounts in a unique user account.)
attr_accessor :name # String
attr_accessor :balance # Money?
has_many :transactions, class_name: "Transaction"
A credit or a debit transaction, with an amount, a date and a description. (How about a payee, only on the YNAB side?)
attr_accessor :type # Symbol? (:credit, :debit)
attr_accessor :amount # Money?
attr_accessor :description # String
attr_accessor :date # Date
Provides:
- coding guidelines
- public API
- basic
Bank
class?
Provides:
- command-line tool (with Thor?)
Implements:
- user credential format (
Hash
or custom class?) - list accounts
- getting balance per account
- getting transactions per account
- transfering money?
Takes a BankAccount
and syncs its transactions with a specific account in
a budget.
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/banks_api
. To experiment with that code, run bin/console
for an interactive prompt.
TODO: Delete this and the text above, and describe your gem
Add this line to your application's Gemfile:
gem 'banks_api'
And then execute:
$ bundle
Or install it yourself as:
$ gem install banks_api
TODO: Write usage instructions here
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/banks_api. 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.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the BanksApi project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.