Redid the augment exercises and based it on a non-XML
[gitmo/moose-presentations.git] / moose-class / exercises / answers / 04-method-modifiers / Employee.pm
CommitLineData
26164c8d 1package Employee;
2
3use Moose;
4
5extends 'Person';
6
7has '+title' => (
8 default => 'Worker',
9);
10
11has salary_level => (
12 is => 'rw',
13 default => 1,
14);
15
16has salary => (
17 is => 'ro',
18 lazy => 1,
19 builder => '_build_salary',
20 init_arg => undef,
21);
22
23has ssn => ( is => 'ro' );
24
25sub _build_salary {
26 my $self = shift;
27
28 return $self->salary_level * 10000;
29}
30
26164c8d 31no Moose;
32
33__PACKAGE__->meta->make_immutable;
34
351;