This a set of exercises which will help you imrpove your Ruby skills. It's intended to:
- Learn language basics, specially Enumerable
- Practice TDD using RSpec
- Practice writing clean code
Intended for beginners and intermediate level developers.
- Basic Ruby and RSpec knowledge.
- Running Ruby development environment
- Fork this repo
- Go to the repo folder
- Run ´bundle install´
- Commit and push you're changes after completing each requirement
- Every completed requirement should include it's corresponding tests
- Use TDD to develop the requirements
- Existing classes can be modified but no new classes should be added
We want to build a phone book to display the names and phone numbers for our contacts. Although we will not build the phone book's UI we need to build a library which complies to the following requirements:
NOTE: Under the
lib
folder we already have theContact
andPhonebook
classes.
-
As a client I want a list of the phone book contacts' names so I can display them to the user
Hint: define a method in the
Phonebook
class which returns an array filled with it's contacts' names. -
As a client I want a list of the phone book contacts' phone numbers so I can display them to the user
Hint: define a method in the
Phonebook
class which returns an array filled with it's contacts' phone numbers. -
As a client I want a mapping of the phone book contacts' names to their phone numbers so I can display the contact's phone numbers under it's name
Hint: define a method in the
Phonebook
class which returns an hash which keys are the contacts' name and which values are the contacts' phone numbers -
As a client I need to know if all the phone book contacts have phone numbers so I can warn the user about incomplete entries
Hint: define a method in the
Phonebook
class which returnstrue
if all contacts have phone numbers andfalse
otherwise -
As a client I want a list of phone book contacts without phone numbers so I can show them to the user
Hint: define a method in the
Phonebook
class which returns an array with contacts without phone numbers
Good luck!