Skip to content

Instantly share code, notes, and snippets.

@xenoterracide
Last active August 29, 2015 14:02
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 xenoterracide/aea326f4ab7f21229576 to your computer and use it in GitHub Desktop.
Save xenoterracide/aea326f4ab7f21229576 to your computer and use it in GitHub Desktop.
package DeperecatedMethod;
use Moose;
our @CARP_NOT = ( 'Class::MOP::Method::Wrapped', __PACKAGE__ );
has value => (
isa => 'Int',
is => 'ro',
lazy => 1,
default => &random_generator,
);
has seed_value => (
isa => 'Int',
is => 'ro',
lazy => 1,
default => &random_generator,
);
before value => sub {
warnings::warnif('deprecated',
'attribute `value` is deprecated use `seed_value`'
);
};
before mymethod => sub {
warnings::warnif('deprecated',
'method `mymethod` is deprecated use `random_generator_instead`'
);
};
sub mymethod {
return random_generator;
}
sub random_generator {
return 9;
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment