X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=moose-class%2Fexercises%2Ft%2F01-classes.t;h=0e83a2ec77e4c9a43a9aa3d0848a7382c766e1fe;hb=ed84c5c65e43867d252f46d13d91df162e6abf6d;hp=e9747fb339917411ace5de0de8b9d95b1bc6e74a;hpb=8d1ce1d704a422c266cc8d3a5a50c98c2a25fc38;p=gitmo%2Fmoose-presentations.git diff --git a/moose-class/exercises/t/01-classes.t b/moose-class/exercises/t/01-classes.t index e9747fb..0e83a2e 100644 --- a/moose-class/exercises/t/01-classes.t +++ b/moose-class/exercises/t/01-classes.t @@ -7,10 +7,19 @@ # * first_name - read-write # * last_name - read-write # -# This class should also have a method named "printable_name". This +# This class should also have a method named "full_name". This # method should return the first and last name separated by a string # ("Jon Smith"). # +# Write a BUILDARGS method for this class which allows the caller to +# pass a two argument array reference. These should be assigned to the +# first and last name respectively. +# +# Person->new( [ 'Lisa', 'Smith' ] ); +# +# Hint: A quick and dirty way to check this is to use ref() to check if the +# first value in @_ is an array reference (perldoc -f ref). A nicer way to do +# this would be use to use Scalar::Util::reftype(). # # Create an Employee class in lib/Employee.pm # @@ -22,7 +31,7 @@ # * salary - read-write # * ssn - read-only # -# The Employee class should override the "printable_name" method to +# The Employee class should override the "full_name" method to # append the employee's title in parentheses ("Jon Smith # (Programmer)"). Use override() and super() for this. #