forked from AdaGold/BankAccounts
-
Notifications
You must be signed in to change notification settings - Fork 26
Anna Bank Accounts Project #3
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
Open
annamm77
wants to merge
26
commits into
Ada-C5:master
Choose a base branch
from
annamm77:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…es a balance and id number. Displays Argument Error if balance is not an integer and greater than 0. Stores instance vars balance and id. Created withdraw method. Fails if withdrawl would cause account balance to go lower than 0. Otherwise will withdraw and update account balance. Created deposit method which also updates account balance. Created check_balance method which displays current balance.
…ess and phone of the owner.
…ed define_user method in Account Class. Still working on how to create a new instance of Owner within the Account class, see lines 45-56. Eventually will need to add in more variables to Owner class, see lines 4 and 7. git status ack what help
…t to get Owner class to initialize within Account.
…ill won't accept a new @owner Bank::Owner even though it will work in IRB, when unattached to the method...? Dunno. Oh wellgit status
added shells for self.all and self.find(id) methods in Accounts. successfully linked csv file. need to figure out how to auto-create new instances of Account using csv data.
Finally figured out how to create a loop for creating Bank::Accounts from the CSV doc.
Also uncovered bug: ArgumentError for balance initailizer breaks self.all method. Turning off the error for now.
Currently it will take the argument (id_num). Loop doesn't work as-is. It will display YAY if it's 1212 but won't work for any other id num...
Fixed the loop, it will now recognize whether or not an id num is in the array, it will put "YAY" if it is found. Yay, indeed...
self.find method appears functional, however when it displays the new Bank::Account instance it does not show the initial arguments. see lines 37-38. All else seems functional, except for ArgumentError which I haven't delved into yet.
Now in the self.all method the id and balance are converted from strings to integers. So the ArgumentError works now! YAY! on to wave 3.
SavingsAccount is a subclass of Account. Adopted all methods from Account. Overridden initialize method. Overridden withdraw method.
Created withdraw_using_check method, added @checkNum to Checking Account.
Caught a bug where self.find wasn't working anymore in Accounts. Updated code so it now returns correct Bank Account afer searching
Extracted numbers and replaced with these variables: @transaction_fee and @balance_min. Added @transacation_fee, @balance_min, and @withdrawl_bal_min = 0 to initializer. @tranasaction_fee will come into play with Checking/Savings. @balance_min is used in initilizer for the Argument Error. @withdrawl_bal_min is used in withdrawl method. Tested Account class and seems to work.
…nd @balance_min and @withdrawl_bal_min in these methods: initialize, withdraw.
Added unique class variables to CheckingAccount: @checkNum @check_bal_min @no_checks_fee Changed "puts" to "returns". Added verbage to CheckingAccount outputs in def withdraw.
Added transaction fee to Account withdraw method, so no need for Savings and Checking withdraw override methods. Updated Savings and Checking initialize override method. Now is "super" and different @transaction_fee, @balance_min, @withdrawl_bal_min and displays Argument Error.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Met primary requirements - no optional enhancements.
Looking forward to getting feedback on this!