diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2015-10-10 14:24:55 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2015-10-10 14:24:55 +0200 |
commit | dce607a72ecc2cc5415ee025452173dc927e1b94 (patch) | |
tree | 8966a95bab6653fa556524c3c21bae13c7d31720 /lib/contact.rb | |
parent | f8cd616b1e7a4565c31579ab17951901902b4453 (diff) | |
download | norsk-urskog-registrations-dce607a72ecc2cc5415ee025452173dc927e1b94.tar.gz norsk-urskog-registrations-dce607a72ecc2cc5415ee025452173dc927e1b94.tar.bz2 norsk-urskog-registrations-dce607a72ecc2cc5415ee025452173dc927e1b94.zip |
Fix init of empty band.
Diffstat (limited to 'lib/contact.rb')
-rw-r--r-- | lib/contact.rb | 12 |
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 |