From: Dave Rolsky Date: Fri, 26 Jun 2009 16:15:35 +0000 (-0500) Subject: Removed as_xml bits from 06 answers X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8883f849385cfb31c597ac880f487ef64b3758db;p=gitmo%2Fmoose-presentations.git Removed as_xml bits from 06 answers --- diff --git a/moose-class/exercises/answers/06-advanced-attributes/Employee.pm b/moose-class/exercises/answers/06-advanced-attributes/Employee.pm index 1bb91fd..11b8db4 100644 --- a/moose-class/exercises/answers/06-advanced-attributes/Employee.pm +++ b/moose-class/exercises/answers/06-advanced-attributes/Employee.pm @@ -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 index db30970..0000000 --- a/moose-class/exercises/answers/06-advanced-attributes/OutputsXML.pm +++ /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{\n} . q{<} - . ( ref $self ) . q{>} . "\n" - . ( join "\n", $self->$orig(@_) ) . "\n" . q{} . "\n"; -}; - -no Moose::Role; - -1; diff --git a/moose-class/exercises/answers/06-advanced-attributes/Person.pm b/moose-class/exercises/answers/06-advanced-attributes/Person.pm index ce155f6..f9bb240 100644 --- a/moose-class/exercises/answers/06-advanced-attributes/Person.pm +++ b/moose-class/exercises/answers/06-advanced-attributes/Person.pm @@ -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;