This is good stuff! Your code passes all of the tests! Here are some notes:
-
Nice handling of full names with 2+ words! Your code can handle any crazy long name that comes its way. Sweet!
-
Nice custom validation method
age_more_than_five
-
This may be picky, but FYI: Your regexp for your phone number validation has spaces in it. The best way to reference the space character in a Ruby regexp is
\s
(although according to this table, the space character will work, as it does in your code). Just keep this in mind for best practices. -
In your full_name method, you joined the
first_name
andlast_name
by putting them into an array, then calling.join
on the array. If these objects are both strings, there is a simpler way:first_name + " " + last_name
Here are the docs for
+
on the Ruby string class.Good work!
-Phil