Ruby Build an Address Book in Ruby Input and Output Adding Contacts: Part 2

Loi Tran
Loi Tran
9,053 Points

adding phone number or address yields multiple contact adds

if you choose to add multiple phone numbers in this program it bugs out and adds multiple contacts instead. just saying =)

Seems to be working as intended for me!

Andrew Phythian
Andrew Phythian
19,746 Points

You might have inserted the line

 contacts.push(contact)

in the wrong place.

Inserting the line before it should be, such as below

                    print "\n"
                    break
            end
            contacts.push(contact)
        end
    end

will result in duplicate entries.

In the correct place

                    print "\n"
                    break
            end
        end
        contacts.push(contact)
    end

it should work as intended.