Browse code
update contacts
Ed Langley authored on 30/10/2017 18:02:03
Showing 1 changed files
Showing 1 changed files
... | ... |
@@ -31,12 +31,24 @@ class AddressBook { |
31 | 31 |
|
32 | 32 |
private val Contacts = List( |
33 | 33 |
Contact("1", |
34 |
- EnglishName("John", Some("Apple"), "Seed"), |
|
35 |
- Address("1103 Foo St.", "Ventura", "CA", "93003", "USA"), |
|
34 |
+ EnglishName("John", Some("Q"), "Public"), |
|
35 |
+ Address("1103 Foo St.", "Somewhere", "CA", "93432", "USA"), |
|
36 | 36 |
pn"333-444-3333"), |
37 |
- Contact("1", |
|
37 |
+ Contact("2", |
|
38 |
+ EnglishName("John", None, "Doe"), |
|
39 |
+ Address("4321 Bellview Blvd", "Youngstown", "OH", "43923", "USA"), |
|
40 |
+ pn"435-2039"), |
|
41 |
+ Contact("3", |
|
42 |
+ EnglishName("Jane", None, "Gray"), |
|
43 |
+ Address("1102 Willow Way", "Seattle", "WA", "10123", "USA"), |
|
44 |
+ pn"435-2039"), |
|
45 |
+ Contact("4", |
|
38 | 46 |
EnglishName("Bob", None, "Marley"), |
39 |
- Address("1103 Maricopa Ave.", "Ventura", "CA", "93003", "USA"), |
|
47 |
+ Address("1103 Maricopa Ave.", "Thousand Oaks", "CA", "93342", "USA"), |
|
48 |
+ pn"435-2039"), |
|
49 |
+ Contact("5", |
|
50 |
+ EnglishName("Mary", Some("E"), "Williamson"), |
|
51 |
+ Address("1102 Birch Ln", "Portland", "OR", "00123", "USA"), |
|
40 | 52 |
pn"435-2039"), |
41 | 53 |
) |
42 | 54 |
|
... | ... |
@@ -71,7 +83,9 @@ case class Picture(width: Int, height: Int, url: Option[String]) |
71 | 83 |
|
72 | 84 |
case class PhoneNumber(countryCode: Int, areaCode: Int, prefix: Int, suffix: Int) { |
73 | 85 |
def formatted = f"(${areaCode}%03d) ${prefix}%03d-${suffix}%04d" |
86 |
+ |
|
74 | 87 |
def localFormatted = f"${prefix}%03d-${suffix}%04d" |
88 |
+ |
|
75 | 89 |
def intlFormatted = f"+$countryCode (${areaCode}%03d) ${prefix}%03d-${suffix}%04d" |
76 | 90 |
} |
77 | 91 |
|