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

Wave 3 Bank Accounts #67

Open
wants to merge 27 commits into
base: jln/master
Choose a base branch
from
Open

Wave 3 Bank Accounts #67

wants to merge 27 commits into from

Conversation

noglows
Copy link

@noglows noglows commented Oct 12, 2015

Added SavingsAccount, CheckingAccount, and MoneyMarketAccount.

CSV is required.

@noglows noglows changed the title Jln/master Wave 3 Bank Accounts Oct 12, 2015
accounts_csv.each do |id, balance, date|
balance = balance.to_f.round(2)/100
date = DateTime.strptime(date, "%Y-%m-%d %H:%M:%S %z")
id = Bank::Account.new(id, balance ,date)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would advise against using the id variable again here since it now stores an account variable rather than an identifier

# Finds the account with the ID that matches the passed parameter and returns the instance
def self.find(id_search)
# Looks in @accounts array for a matching ID value
found = @accounts.find do |account|

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the all method is not called before the find method is called then this method will not have the @account variable stored

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants