This is a Ruby program to imitate the functionality of a simple bank.
I wanted to practice my Ruby skills, specifically those of good separation of concerns, good Object Oriented Design, and effective Test Driven Development.
- Ruby
- run rspec from the command line
-
Open irb in the command line
- require './lib/bank.rb'
- require './lib/account.rb'
-
create new instances of:
- bank = Bank.new
- account = Account.new
-
join the bank!
- bank.deposit(100)
- bank.balance
- bank.withdraw(50)
- separate out the deposits and withdrawals storage into an account class.
- separate out the display deposits and withdrawals into the statement class.
- add the time stamp functionality to the statement class.
-
As a bank customer, So I can save and store money, I want to be able to make a deposit for an amount of money at the bank and see an updated balance.
-
As a bank customer, so I can spend money, I want to be able to withdraw an amount of money from the bank, and see an updated balance.
-
As a bank customer, so that I can keep track of my bank balance and my spending, I want to be able to print a statement from the bank, showing my balance.
-
As A bank customer, so that I can determine exactly when I made deposits and withdrawals, I want each deposit and withdrawal to have an associated date.