Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jackie - Bank Account #33

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
18657e3
created initial structure of module and class
jackiewatanabe Feb 21, 2017
49f6f01
initialized with ID and initial balance
jackiewatanabe Feb 21, 2017
26b1e13
added withdraw method
jackiewatanabe Feb 21, 2017
22f4fcf
added deposit method
jackiewatanabe Feb 21, 2017
8d3b6de
added balance attr_reader so balance can be accessed any time
jackiewatanabe Feb 21, 2017
abfe8f3
updated attr_reader to go inside class Account
jackiewatanabe Feb 21, 2017
69429f1
added if/else statement in initialize to make sure initial balance is…
jackiewatanabe Feb 21, 2017
16af257
updated if/else statement to include initial balances of 0
jackiewatanabe Feb 21, 2017
150a523
added :id as a reader attribute
jackiewatanabe Feb 21, 2017
09f980a
added start and update balance local variables in withdraw method
jackiewatanabe Feb 22, 2017
ff4a411
added conditional to account for a withdraw amount that's negative
jackiewatanabe Feb 22, 2017
8928a43
added conditional to deposit method to require amount greater than ze…
jackiewatanabe Feb 22, 2017
52127dd
created an Owner class that takes in user info hashes
jackiewatanabe Feb 22, 2017
c5eda71
added test for initializing owner info
jackiewatanabe Feb 22, 2017
5641ef2
created Accounts.all class method and updated spec file to check for …
jackiewatanabe Feb 22, 2017
d8d361e
added test to check if eveverything in Array is an Account. Also crea…
jackiewatanabe Feb 23, 2017
78ec7a3
added tests to check ID/balance of first and last elements
jackiewatanabe Feb 23, 2017
f680527
created separate it/do's for each test
jackiewatanabe Feb 23, 2017
d6a10e4
created Account.find class method and set up test to ensure it return…
jackiewatanabe Feb 23, 2017
461974a
added tests to ensure .find class method can find the first and last …
jackiewatanabe Feb 23, 2017
760a46b
created test to check for accounts that don't exist and added code in…
jackiewatanabe Feb 23, 2017
1b8ec98
refactored .find class method to get rid of if/else when raising argu…
jackiewatanabe Feb 23, 2017
4efca9d
refactored code in initialize, withdraw, and deposit methods to get r…
jackiewatanabe Feb 23, 2017
21b764f
refactored specs code to get rid of unnecessary variables, instead us…
jackiewatanabe Feb 23, 2017
bc5e8ca
refactored code back to add variable @account_array set to Bank::Acco…
jackiewatanabe Feb 23, 2017
b034bd1
created class files for SavingsAccount and CheckingAccount
jackiewatanabe Feb 23, 2017
240f03e
changed file name to savings_account.rb and added initialize super
jackiewatanabe Feb 24, 2017
e9b3eb7
added 'require_relative 'account'' and also added conditionals and su…
jackiewatanabe Feb 24, 2017
2b8a2b8
adjusted withdraw method to account for withdrawals that will put acc…
jackiewatanabe Feb 24, 2017
352a576
added add_interest method to SavingsAccount and created test
jackiewatanabe Feb 24, 2017
f06688f
restructured add_interest rate and test to only show interest rate
jackiewatanabe Feb 24, 2017
ec2bcdf
adjusted test to check for only interest added on add_interest method
jackiewatanabe Feb 24, 2017
62f197a
created test to make sure add_interest updates balance with the calcu…
jackiewatanabe Feb 24, 2017
945477b
created CheckingAccount subclass with updated withdraw method. Added …
jackiewatanabe Feb 24, 2017
fa780e1
added test to make sure balance is not modified if fee would put it n…
jackiewatanabe Feb 24, 2017
4dd4b1c
wrote test to check if withdraw_using check reduces balance. Added me…
jackiewatanabe Feb 24, 2017
826af7c
wrote test to make sure withdraw_check method returns modified balanc…
jackiewatanabe Feb 24, 2017
2376c12
created test to make sure method allows withdrawing checks that puts …
jackiewatanabe Feb 24, 2017
4f7eff0
added test to see if method outputs warning if account goes below neg…
jackiewatanabe Feb 24, 2017
b1fbb50
added test and code to make sure check is a positive number
jackiewatanabe Feb 24, 2017
16f2c49
created tests to allow three free checks and then apply 2 dollar fee …
jackiewatanabe Feb 24, 2017
87242c6
created tests to check reset checks method. created method to reset c…
jackiewatanabe Feb 24, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated attr_reader to go inside class Account
jackiewatanabe committed Feb 21, 2017

Verified

This commit was signed with the committer’s verified signature. The key has expired.
commit abfe8f3b56d32ff783fb9113e1b51a032ba9e108
4 changes: 2 additions & 2 deletions lib/account.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module Bank
attr_reader :balance

class Account

attr_reader :balance

def initialize (id, balance)
@id = id
@balance = balance

end

def withdraw(money_to_withdraw)