=> via { $en_parser->parse_datetime($_) };
has birth_date => (
- is => 'rw',
- isa => 'DateTime',
- coerce => 1,
+ is => 'rw',
+ isa => 'DateTime',
+ coerce => 1,
+ handles => { birth_year => 'year' },
);
subtype 'ShirtSize'
return $self->{birth_date};
}
+ sub birth_year {
+ my $self = shift;
+
+ return $self->birth_date->year;
+ }
+
sub shirt_size {
my $self = shift;