$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
-requires 'helper_type';
+requires '_helper_type';
# these next two are the possible methods
# you can use in the 'handles' map.
sub _check_helper_type {
my ( $self, $options, $name ) = @_;
- my $type = $self->helper_type;
+ my $type = $self->_helper_type;
- $options->{isa} = $self->helper_type
+ $options->{isa} = $type
unless exists $options->{isa};
my $isa = Moose::Util::TypeConstraints::find_or_create_type_constraint(
with 'Moose::AttributeHelpers::Trait::Base';
-sub helper_type { 'Bool' }
-
sub _default_is { 'rw' }
+sub _helper_type { 'Bool' }
# NOTE:
# we don't use the method provider for this
=item B<meta>
-=item B<helper_type>
-
=item B<method_constructors>
=item B<has_method_provider>
default => 'Moose::AttributeHelpers::MethodProvider::Array'
);
-sub helper_type { 'ArrayRef' }
+sub _helper_type { 'ArrayRef' }
no Moose::Role;
=item B<has_method_provider>
-=item B<helper_type>
-
=back
=head1 BUGS
subtype 'Bag' => as 'HashRef[Int]';
-sub helper_type { 'Bag' }
+sub _helper_type { 'Bag' }
sub _default_default { sub { {} } }
=item B<has_method_provider>
-=item B<helper_type>
-
-=item B<process_options_for_handles>
-
=back
=head1 BUGS
default => 'Moose::AttributeHelpers::MethodProvider::Hash'
);
-sub helper_type { 'HashRef' }
+sub _helper_type { 'HashRef' }
no Moose::Role;
=item B<has_method_provider>
-=item B<helper_type>
-
=back
=head1 BUGS
default => 'Moose::AttributeHelpers::MethodProvider::ImmutableHash'
);
-sub helper_type { 'HashRef' }
+sub _helper_type { 'HashRef' }
no Moose::Role;
=item B<has_method_provider>
-=item B<helper_type>
-
=back
=head1 BUGS
default => 'Moose::AttributeHelpers::MethodProvider::List'
);
-sub helper_type { 'ArrayRef' }
+sub _helper_type { 'ArrayRef' }
no Moose::Role;
=item B<has_method_provider>
-=item B<helper_type>
-
=back
=head1 BUGS
sub _default_default { 0 }
sub _default_is { 'ro' }
-
-sub helper_type { 'Num' }
+sub _helper_type { 'Num' }
after '_check_handles_values' => sub {
my $self = shift;
=item B<has_method_provider>
-=item B<helper_type>
-
=back
=head1 PROVIDED METHODS
with 'Moose::AttributeHelpers::Trait::Base';
-sub helper_type { 'Num' }
+sub _helper_type { 'Num' }
# NOTE:
# we don't use the method provider for this
=item B<meta>
-=item B<helper_type>
-
=item B<method_constructors>
=back
default => 'Moose::AttributeHelpers::MethodProvider::String',
);
-sub helper_type { 'Str' }
-
sub _default_default { q{} }
sub _default_is { 'rw' }
+sub _helper_type { 'Str' }
after '_check_handles_values' => sub {
my $self = shift;
=item B<has_method_provider>
-=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
use strict;
use warnings;
-use Test::More tests => 14;
+use Test::More tests => 13;
use Test::Moose;
BEGIN {
my $counter = $page->meta->get_attribute('counter');
does_ok($counter, 'Moose::AttributeHelpers::Trait::Counter');
-is($counter->helper_type, 'Num', '... got the expected helper type');
-
is($counter->type_constraint->name, 'Num', '... got the expected default type constraint');
is_deeply($counter->handles, {
use strict;
use warnings;
-use Test::More tests => 18;
+use Test::More tests => 17;
use Test::Moose 'does_ok';
BEGIN {
my $counter = $page->meta->get_attribute('counter');
does_ok($counter, 'Moose::AttributeHelpers::Trait::Counter');
-is($counter->helper_type, 'Num', '... got the expected helper type');
-
is($counter->type_constraint->name, 'Int', '... got the expected type constraint');
is_deeply($counter->handles, {
use strict;
use warnings;
-use Test::More tests => 21;
+use Test::More tests => 20;
use Test::Moose 'does_ok';
BEGIN {
my $string = $page->meta->get_attribute('string');
does_ok($string, 'Moose::AttributeHelpers::Trait::String');
-is($string->helper_type, 'Str', '... got the expected helper type');
-
is($string->type_constraint->name, 'Str', '... got the expected type constraint');
is_deeply($string->handles, {