Skip to content

Commit 6f74fff

Browse files
committed
Merge pull request #47 from lacuchilla/arh/master
Arh/master
2 parents 0b0df06 + 74e23b5 commit 6f74fff

File tree

5 files changed

+58
-3
lines changed

5 files changed

+58
-3
lines changed

README.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ Create an `Account` class which should have the following functionality:
3535
- Add an `owner` property to each Account to track information about who owns the account.
3636
- The `Account` can be created with an `owner`, OR you can create a method that will add the `owner` after the `Account` has already been created.
3737

38-
<!--
38+
3939
## Wave 2
4040
### CSV Files!
41+
- Update the `Account` class to be able to handle all of these fields from the CSV file used as input.
42+
- For example, manually choose the data from the first line of the CSV file and ensure you can create a new instance of your Account using that data
4143
- Add the following **class** methods to your existing `Account` class
4244
- `self.all` - returns a collection of `Account` instances, representing all of the Accounts described in the CSV. See below for the CSV file specifications
4345
- `self.find(id)` - returns an instance of `Account` where the value of the id field in the CSV matches the passed parameter
44-
- Update the `Account` class to be able to handle all of these fields from the CSV file used as input.
46+
4547

4648
#### CSV Data File
4749
Bank::Account
@@ -57,6 +59,21 @@ Create an `Account` class which should have the following functionality:
5759
- `self.all` - returns a collection of `Owner` instances, representing all of the Owners described in the CSV. See below for the CSV file specifications
5860
- `self.find(id)` - returns an instance of `Owner` where the value of the id field in the CSV matches the passed parameter
5961

62+
Bank::Owner
63+
The data, in order in the CSV, consists of:
64+
**ID** - (Fixnum) a unique identifier for that Owner
65+
**Last Name** - (String) the owner's last name
66+
**First Name** - (String) the owner's first name
67+
**Street Addess** - (String) the owner's street address
68+
**City** - (String) the owner's city
69+
**State** - (String) the owner's state
70+
71+
To create the relationship between the accounts and the owners use the `account_owners` CSV file.
72+
The data for this file, in order in the CSV, consists of:
73+
**Account ID** - (Fixnum) a unique identifier corresponding to an account
74+
**Owner ID** - (Fixnum) a unique identifier corresponding to an owner
75+
76+
<!--
6077
## Wave 3
6178
Create a `SavingsAccount` class which should inherit behavior from the `Account` class. It should include updated logic with the following functionality:
6279
- An updated `initialize` method:

bankaccounttest.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'csv'
2+
13
module Bank
24
class Account
35
attr_accessor :account_id, :account_balance, :amount
@@ -20,7 +22,7 @@ def withdraw
2022
@amount = gets.chomp.to_i
2123
if @account_balance - @amount < 0
2224
puts ("Cannot withdraw an amount that will make the balance negative.")
23-
puts @account_balance
25+
puts "Your current balance is #{@account_balance}."
2426
else
2527
@account_balance -= @amount
2628
puts "Your new balance is: #{@account_balance} dollars."

support/account_owners.csv

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
1212,25
2+
1213,24
3+
1214,19
4+
1215,14
5+
1216,18
6+
1217,15
7+
15151,17
8+
15152,16
9+
15153,21
10+
15154,20
11+
15155,22
12+
15156,23

support/accounts.csv

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
1212,1235667,1999-03-27 11:30:09 -0800
2+
1213,66367,2010-12-21 12:21:12 -0800
3+
1214,9876890,2007-09-22 11:53:00 -0800
4+
1215,919191,2011-10-31 13:55:55 -0800
5+
1216,100022,2000-07-07 15:07:55 -0800
6+
1217,12323,2003-11-07 11:34:56 -0800
7+
15151,9844567,1993-01-17 13:30:56 -0800
8+
15152,34343434343,1999-02-12 14:03:00 -0800
9+
15153,2134,2013-11-07 09:04:56 -0800
10+
15154,43567,1996-04-17 08:44:56 -0800
11+
15155,999999,1990-06-10 13:13:13 -0800
12+
15156,4356772,1994-11-17 14:04:56 -0800

support/owners.csv

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
14,Morales,Wanda,9003 Gerald Hill,Honolulu,Hawaii
2+
15,Foster,Shirley,79734 Namekagon Court,Tampa,Florida
3+
16,Taylor,James,9 Portage Court,Winston Salem,North Carolina
4+
17,Ross,Marilyn,0 Delaware Circle,Seattle,Washington
5+
18,Gonzalez,Laura,310 Hauk Street,Springfield,Illinois
6+
19,Cooper,Ruby,99 American Road,Atlanta,Georgia
7+
20,Knight,Helen,3373 American Point,Charlotte,North Carolina
8+
21,Bell,Jessica,06 Kenwood Hill,Lansing,Michigan
9+
22,Sanders,Annie,8113 Sutherland Center,Everett,Washington
10+
23,Berry,Shirley,7 Kings Pass,Cleveland,Ohio
11+
24,King,Kevin,3499 Judy Center,Santa Monica,California
12+
25,Clark,Kathleen,72984 Chive Hill,New York City,New York

0 commit comments

Comments
 (0)