default => 'Moose::AttributeHelpers::MethodProvider::Counter',
);
-sub helper_type { 'Num' }
-
-before 'process_options_for_handles' => sub {
- my ( $self, $options, $name ) = @_;
+sub _default_default { 0 }
+sub _default_is { 'ro' }
- # Set some default attribute options here unless already defined
- if ( ( my $type = $self->helper_type ) && !exists $options->{isa} ) {
- $options->{isa} = $type;
- }
-
- $options->{is} = 'ro' unless exists $options->{is};
- $options->{default} = 0 unless exists $options->{default};
-};
+sub helper_type { 'Num' }
-after 'check_handles_values' => sub {
+after '_check_handles_values' => sub {
my $self = shift;
my $handles = $self->handles;
metaclass => 'Counter',
is => 'ro',
isa => 'Num',
- default => sub { 0 },
+ default => 0,
handles => {
inc_counter => 'inc',
dec_counter => 'dec',
);
my $page = MyHomePage->new();
- $page->inc_counter; # same as $page->counter($page->counter + 1);
- $page->dec_counter; # same as $page->counter($page->counter - 1);
+ $page->inc_counter; # same as $page->counter( $page->counter + 1 );
+ $page->dec_counter; # same as $page->counter( $page->counter - 1 );
=head1 DESCRIPTION
=item B<helper_type>
-=item B<process_options_for_handles>
-
-Run before its superclass method.
-
-=item B<check_handles_values>
-
-Run after its superclass method.
-
=back
=head1 PROVIDED METHODS