From: Dave Rolsky Date: Mon, 6 Jul 2009 19:10:58 +0000 (-0500) Subject: Removed unneeded answer files X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=08c517d44faac914904830d32b8a5b48ae2393c0;p=gitmo%2Fmoose-presentations.git Removed unneeded answer files --- diff --git a/moose-class/exercises/answers/04-method-modifiers/Employee.pm b/moose-class/exercises/answers/04-method-modifiers/Employee.pm deleted file mode 100644 index 11b8db4..0000000 --- a/moose-class/exercises/answers/04-method-modifiers/Employee.pm +++ /dev/null @@ -1,35 +0,0 @@ -package Employee; - -use Moose; - -extends 'Person'; - -has '+title' => ( - default => 'Worker', -); - -has salary_level => ( - is => 'rw', - default => 1, -); - -has salary => ( - is => 'ro', - lazy => 1, - builder => '_build_salary', - init_arg => undef, -); - -has ssn => ( is => 'ro' ); - -sub _build_salary { - my $self = shift; - - return $self->salary_level * 10000; -} - -no Moose; - -__PACKAGE__->meta->make_immutable; - -1; diff --git a/moose-class/exercises/answers/04-method-modifiers/HasAccount.pm b/moose-class/exercises/answers/04-method-modifiers/HasAccount.pm deleted file mode 100644 index 76ea15e..0000000 --- a/moose-class/exercises/answers/04-method-modifiers/HasAccount.pm +++ /dev/null @@ -1,29 +0,0 @@ -package HasAccount; - -use Moose::Role; - -has balance => ( - is => 'rw', - default => 100, -); - -sub deposit { - my $self = shift; - my $amount = shift; - - $self->balance( $self->balance + $amount ); -} - -sub withdraw { - my $self = shift; - my $amount = shift; - - die "Balance cannot be negative" - if $self->balance < $amount; - - $self->balance( $self->balance - $amount ); -} - -no Moose::Role; - -1; diff --git a/moose-class/exercises/answers/04-method-modifiers/Person.pm b/moose-class/exercises/answers/04-method-modifiers/Person.pm deleted file mode 100644 index 6c4ce19..0000000 --- a/moose-class/exercises/answers/04-method-modifiers/Person.pm +++ /dev/null @@ -1,33 +0,0 @@ -package Person; - -use Moose; - -with 'Printable', 'HasAccount', 'OutputsXML'; - -has title => ( - is => 'rw', - predicate => 'has_title', - clearer => 'clear_title', -); - -has first_name => ( is => 'rw' ); - -has last_name => ( is => 'rw' ); - -sub full_name { - my $self = shift; - - my $title = join q{ }, $self->first_name, $self->last_name; - $title .= q[ (] . $self->title . q[)] - if $self->has_title; - - return $title; -} - -sub as_string { $_[0]->full_name } - -no Moose; - -__PACKAGE__->meta->make_immutable; - -1; diff --git a/moose-class/exercises/answers/04-method-modifiers/Printable.pm b/moose-class/exercises/answers/04-method-modifiers/Printable.pm deleted file mode 100644 index cb9b58c..0000000 --- a/moose-class/exercises/answers/04-method-modifiers/Printable.pm +++ /dev/null @@ -1,9 +0,0 @@ -package Printable; - -use Moose::Role; - -requires 'as_string'; - -no Moose::Role; - -1;