Skip to content

Instantly share code, notes, and snippets.

@mstratman
Created March 11, 2011 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mstratman/865253 to your computer and use it in GitHub Desktop.
Save mstratman/865253 to your computer and use it in GitHub Desktop.
package MyDate;
use Moose;
use namespace::autoclean;
use Date::Handler;
has '_date_handler' => (
is => 'ro',
isa => 'Date::Handler',
handles => qr/.*/,
);
around BUILDARGS => sub {
my $orig = shift;
my $class = shift;
return $class->$orig(_date_handler => Date::Handler->new(@_));
};
no Moose;
__PACKAGE__->meta->make_immutable;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment