add some more slies on object construction, make ol and li style the same
[gitmo/moose-presentations.git] / moose-class / exercises / answers / 04-method-modifiers / OutputsXML.pm
1 package OutputsXML;
2
3 use Moose::Role;
4
5 requires 'as_xml';
6
7 around as_xml => sub {
8     my $orig = shift;
9     my $self = shift;
10
11     return
12           qq{<?xml version="1.0" encoding="UTF-8"?>\n} . q{<}
13         . ( ref $self ) . q{>} . "\n"
14         . ( join "\n", $self->$orig(@_) ) . "\n" . q{</}
15         . ( ref $self ) . q{>} . "\n";
16 };
17
18 no Moose::Role;
19
20 1;