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;
+++ /dev/null
-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;
use BankAccount;
use Moose;
-with 'Printable', 'OutputsXML';
+with 'Printable';
has account => (
is => 'rw',
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;