jmmastey/level_up_exercises — pull request #223 by paulh16 (2014-11-05 18:23:20+00:00)
Title: Robot name pgh

I wasn't sure if I need to open a new pull request for the minor change suggested in the first iteration. I made that change, plus a couple extra that I noticed.

Changes in this iteration:

1. Add a second Exception Class, NameInvalidError, that more accurately describes an error raised when the name is invalid.

2. Change the way the new Exception classes are instantiated, using Class.new.

3. Change the method name, assign_name, to generate_name for more clarity.

4. Make use of Object#method to eliminate the need for the if statement in the old assign_name method. This also required setting @generate_name to the :default_name method object if no parameters are passed into the object upon instantiation.