-
Notifications
You must be signed in to change notification settings - Fork 39
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
Brenna's BankAcccounts #20
base: master
Are you sure you want to change the base?
Conversation
…draw method that passed first test
…sts, wave 3 complete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work overall. Just a few comments in the code here.
return @all_accounts if @all_accounts | ||
@all_accounts = [] | ||
CSV.open("/Users/brenna/ada/week3/BankAccounts/support/accounts.csv").each do | line | | ||
@all_accounts << Bank::Account.new(line[0].to_i, line[1].to_f, line[2]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can get this to work with: support/accounts.csv
instead, that way it will work if you move the project to another folder.
return @all_owners if @all_owners | ||
@all_owners = [] | ||
CSV.open("/Users/brenna/ada/week3/BankAccounts/support/account_owners.csv").each do | line | | ||
owner_hash = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the above, you can use support/account_owners.csv
.
@@ -0,0 +1,30 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file should probably be named savings_account.rb
instead, but not a big deal.
@check_count = 0 | ||
end | ||
|
||
def withdraw(withdrawal_amount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use super in this method?
print "There must always be at least $10 in your savings." | ||
return @balance | ||
end | ||
super |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of super.
Bank AccountWhat We're Looking For
SummaryNicely done overall. Some of your methods most notably, |
Bank Account
Congratulations! You're submitting your assignment.
Comprehension Questions
raise ArgumentError
? What do you think it's doing?.all
&.find
methods class methods? Why not instance methods?