Removed as_xml bits from 06 answers
Dave Rolsky [Fri, 26 Jun 2009 16:15:35 +0000 (11:15 -0500)]
moose-class/exercises/answers/06-advanced-attributes/Employee.pm
moose-class/exercises/answers/06-advanced-attributes/OutputsXML.pm [deleted file]
moose-class/exercises/answers/06-advanced-attributes/Person.pm

index 1bb91fd..11b8db4 100644 (file)
@@ -28,14 +28,6 @@ sub _build_salary {
     return $self->salary_level * 10000;
 }
 
-augment as_xml => sub {
-    my $self = shift;
-
-    return
-        ( map { "<$_>" . ( $self->$_ || q{} ) . "</$_>" } qw( salary salary_level ssn ) ),
-        inner();
-};
-
 no Moose;
 
 __PACKAGE__->meta->make_immutable;
diff --git a/moose-class/exercises/answers/06-advanced-attributes/OutputsXML.pm b/moose-class/exercises/answers/06-advanced-attributes/OutputsXML.pm
deleted file mode 100644 (file)
index db30970..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-package OutputsXML;
-
-use Moose::Role;
-
-requires 'as_xml';
-
-around as_xml => sub {
-    my $orig = shift;
-    my $self = shift;
-
-    return
-          qq{<?xml version="1.0" encoding="UTF-8"?>\n} . q{<}
-        . ( ref $self ) . q{>} . "\n"
-        . ( join "\n", $self->$orig(@_) ) . "\n" . q{</}
-        . ( ref $self ) . q{>} . "\n";
-};
-
-no Moose::Role;
-
-1;
index ce155f6..f9bb240 100644 (file)
@@ -3,7 +3,7 @@ package Person;
 use BankAccount;
 use Moose;
 
-with 'Printable', 'OutputsXML';
+with 'Printable';
 
 has account => (
     is      => 'rw',
@@ -40,14 +40,6 @@ sub full_name {
 
 sub as_string { $_[0]->full_name }
 
-sub as_xml {
-    my $self = shift;
-
-    return
-        ( map { "<$_>" . ( $self->$_ || q{} ) . "</$_>" } qw( first_name last_name title ) ),
-        inner();
-}
-
 no Moose;
 
 __PACKAGE__->meta->make_immutable;