- Go to: https://github.com/anushanesargi/airport_challenge
- Fork this repo, and run git clone SSH key on your local machine
- Run the command 'bundle install' to install all the bundles required to run the program
- run 'rspec' to test the testcases
- run 'rubocop' for linting
- run 'irb'
- run the following commands in irb:
require_relative'account'
require_relative'statement'
clients_account = Account.new(0, [])
clients_account.deposit('10/01/2023', 1000)
clients_account.deposit('13/01/2023', 2000)
clients_account.withdraw('14/01/2023', 500)
bank_statement = Statement.new(clients_account)
bank_statement.statement_print
- Reading through the problem statement.
- Writing the user cases
- Writing down briefly the steps required to solve the problem
- Modelling
- Writing simple test for the first user case
- Writing the logic to pass the failing test
- Committing the code
- Next usercase, another test - which fails, solving the failed test with logic implementation
- Changed the names of the methods to suit the problem statement
- class Account: . Needs two arguments to be passed to the constructor: a. intial balance b. initial passbook log in an array format which consits of hashes eg. [{date: '', credit: '', debit: '', balance: ''}] . Encapsulates, the account operations such as deposits, withdrawals and logging the transactions
- class Statement . Prints the bank statement in a particular fashion: date || credit || debit || balance . This class is dependent on Account class and needs an account instance to be passed to its constructor.