summaryrefslogtreecommitdiffstats
path: root/lib/contact.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/contact.rb')
-rw-r--r--lib/contact.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/contact.rb b/lib/contact.rb
index 1e6ba4b..0d87012 100644
--- a/lib/contact.rb
+++ b/lib/contact.rb
@@ -1,10 +1,12 @@
class Contact
attr_reader :name, :addr, :phone, :email
- def initialize(params)
- @name = params['name']
- @addr = params['addr']
- @phone = params['phone']
- @email = params['email']
+ def initialize(params = nil)
+ if params
+ @name = params['name']
+ @addr = params['addr']
+ @phone = params['phone']
+ @email = params['email']
+ end
end
end