Open
Conversation
Bank module contains Account and Owner classes. Account accepts an id and initial balance and an optional owner. Account contains methods to deposit and withdraw from the account balance. Owner accepts a hash containing identifying information about the account owner.
…d in the owner object;
…d balance and opendate as the value;
Tried to tackle the all method by both creating all instances of Account from a csv file and returning them in an array. Need to collect the data from csv in a method separately and return all instances in its own method. Oh god, send help.
Separated the responsibilities of create_from_csv to three methods for clarity. csv_data only reads data from a specific csv file. accounts creates accounts based on the csv_data. all returns an accounts.
…method takes any csv file path;
…st account in the accounts array;
…f array; find method is broken;
…, compares a given input to the ids of accounts and returns account if it matches;
…can read a given csv file and put into array;
…_data; changed required parameters for Owner class;
… each line in csv to create owner instance from hash;
…s method can return the correct instance of Owner when given one account id;
…ny given account id if it exists;
…ass that has unique min balance and withdraw fee constants;
…interested based on input rate; Refer to balance method instead of balance instance variable wherever possible;
…Account withdraw method but includes some unique variables for this case; Created reset_checks method to reset the number of checks used to 0;
…counts; Made method to handle initial balance errors; Override withdraw_error method in MoneyMarketAccount;
…ls count as transactions, also reset count method; MoneyMarketAccount has special rules about transaction counts;
…l was redundant, I hope it is not broken;
…instance variables;
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
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.
Worked on by Sophia Baldonado.
I have to require CSV but I think that's part of ruby.
I'm really excited that I was able to define most of the behavior in the base class, Account. I had some trouble with Constants so I ended up having to assign them to instance variables and use them that way but I think I will look into them more. I just have to target them differently with self.class::CONSTANT I think.