my @trait_names = qw(Bool Counter Number String Array Hash);
for my $trait_name (@trait_names) {
- my $trait_class = "Moose::Meta::Attribute::Trait::Native::$trait_name";
+ my $trait_class = "Moose::Meta::Attribute::Native::Trait::$trait_name";
my $meta = Class::MOP::Class->initialize(
"Moose::Meta::Attribute::Custom::Trait::$trait_name"
);
=over
-=item L<Number|Moose::Meta::Attribute::Trait::Native::Number>
+=item L<Number|Moose::Meta::Attribute::Native::Trait::Number>
Common numerical operations.
-=item L<String|Moose::Meta::Attribute::Trait::Native::String>
+=item L<String|Moose::Meta::Attribute::Native::Trait::String>
Common methods for string operations.
-=item L<Counter|Moose::Meta::Attribute::Trait::Native::Counter>
+=item L<Counter|Moose::Meta::Attribute::Native::Trait::Counter>
Methods for incrementing and decrementing a counter attribute.
-=item L<Bool|Moose::Meta::Attribute::Trait::Native::Bool>
+=item L<Bool|Moose::Meta::Attribute::Native::Trait::Bool>
Common methods for boolean values.
-=item L<Hash|Moose::Meta::Attribute::Trait::Native::Hash>
+=item L<Hash|Moose::Meta::Attribute::Native::Trait::Hash>
Common methods for hash references.
-=item L<ImmutableHash|Moose::Meta::Attribute::Trait::Native::ImmutableHash>
+=item L<ImmutableHash|Moose::Meta::Attribute::Native::Trait::ImmutableHash>
Common methods for inspecting hash references.
-=item L<Array|Moose::Meta::Attribute::Trait::Native::Array>
+=item L<Array|Moose::Meta::Attribute::Native::Trait::Array>
Common methods for array references.
-=item L<List|Moose::Meta::Attribute::Trait::Native::List>
+=item L<List|Moose::Meta::Attribute::Native::Trait::List>
Common list methods for array references.
-package Moose::Meta::Attribute::Trait::Native::MethodProvider::Array;
+package Moose::Meta::Attribute::Native::MethodProvider::Array;
use Moose::Role;
our $VERSION = '0.87';
=head1 NAME
-Moose::Meta::Attribute::Trait::Native::MethodProvider::Array
+Moose::Meta::Attribute::Native::MethodProvider::Array
=head1 SYNOPSIS
-package Moose::Meta::Attribute::Trait::Native::MethodProvider::Bool;
+package Moose::Meta::Attribute::Native::MethodProvider::Bool;
use Moose::Role;
our $VERSION = '0.87';
=head1 NAME
-Moose::Meta::Attribute::Trait::Native::MethodProvider::Bool
+Moose::Meta::Attribute::Native::MethodProvider::Bool
=head1 DESCRIPTION
-package Moose::Meta::Attribute::Trait::Native::MethodProvider::Counter;
+package Moose::Meta::Attribute::Native::MethodProvider::Counter;
use Moose::Role;
our $VERSION = '0.87';
=head1 NAME
-Moose::Meta::Attribute::Trait::Native::MethodProvider::Counter
+Moose::Meta::Attribute::Native::MethodProvider::Counter
=head1 DESCRIPTION
-package Moose::Meta::Attribute::Trait::Native::MethodProvider::Hash;
+package Moose::Meta::Attribute::Native::MethodProvider::Hash;
use Moose::Role;
our $VERSION = '0.87';
=head1 NAME
-Moose::Meta::Attribute::Trait::Native::MethodProvider::Hash
+Moose::Meta::Attribute::Native::MethodProvider::Hash
=head1 DESCRIPTION
-package Moose::Meta::Attribute::Trait::Native::MethodProvider::String;
+package Moose::Meta::Attribute::Native::MethodProvider::String;
use Moose::Role;
our $VERSION = '0.87';
=head1 NAME
-Moose::Meta::Attribute::Trait::Native::MethodProvider::String
+Moose::Meta::Attribute::Native::MethodProvider::String
=head1 DESCRIPTION
-package Moose::Meta::Attribute::Trait::Native;
+package Moose::Meta::Attribute::Native::Trait;
use Moose::Role;
use Moose::Util::TypeConstraints;
=head1 NAME
-Moose::Meta::Attribute::Trait::Native - base role for helpers
+Moose::Meta::Attribute::Native::Trait - base role for helpers
=head1 BUGS
-package Moose::Meta::Attribute::Trait::Native::Array;
+package Moose::Meta::Attribute::Native::Trait::Array;
use Moose::Role;
our $VERSION = '0.87';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
-use Moose::Meta::Attribute::Trait::Native::MethodProvider::Array;
+use Moose::Meta::Attribute::Native::MethodProvider::Array;
-with 'Moose::Meta::Attribute::Trait::Native';
+with 'Moose::Meta::Attribute::Native::Trait';
has 'method_provider' => (
is => 'ro',
isa => 'ClassName',
predicate => 'has_method_provider',
- default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::Array'
+ default => 'Moose::Meta::Attribute::Native::MethodProvider::Array'
);
sub _helper_type { 'ArrayRef' }
=head1 NAME
-Moose::Meta::Attribute::Trait::Native::Array
+Moose::Meta::Attribute::Native::Trait::Array
=head1 SYNOPSIS
=head1 DESCRIPTION
This module provides an Array attribute which provides a number of
-array operations. See L<Moose::Meta::Attribute::Trait::Native::MethodProvider::Array>
+array operations. See L<Moose::Meta::Attribute::Native::MethodProvider::Array>
for more details.
=head1 METHODS
-package Moose::Meta::Attribute::Trait::Native::Bool;
+package Moose::Meta::Attribute::Native::Trait::Bool;
use Moose::Role;
-use Moose::Meta::Attribute::Trait::Native::MethodProvider::Bool;
+use Moose::Meta::Attribute::Native::MethodProvider::Bool;
our $VERSION = '0.87';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
-with 'Moose::Meta::Attribute::Trait::Native';
+with 'Moose::Meta::Attribute::Native::Trait';
sub _default_is { 'rw' }
sub _helper_type { 'Bool' }
is => 'ro',
isa => 'ClassName',
predicate => 'has_method_provider',
- default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::Bool'
+ default => 'Moose::Meta::Attribute::Native::MethodProvider::Bool'
);
no Moose::Role;
=head1 NAME
-Moose::Meta::Attribute::Trait::Native::Bool
+Moose::Meta::Attribute::Native::Trait::Bool
=head1 SYNOPSIS
-package Moose::Meta::Attribute::Trait::Native::Counter;
+package Moose::Meta::Attribute::Native::Trait::Counter;
use Moose::Role;
our $VERSION = '0.87';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
-use Moose::Meta::Attribute::Trait::Native::MethodProvider::Counter;
+use Moose::Meta::Attribute::Native::MethodProvider::Counter;
-with 'Moose::Meta::Attribute::Trait::Native';
+with 'Moose::Meta::Attribute::Native::Trait';
has 'method_provider' => (
is => 'ro',
isa => 'ClassName',
predicate => 'has_method_provider',
- default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::Counter',
+ default => 'Moose::Meta::Attribute::Native::MethodProvider::Counter',
);
sub _default_default { 0 }
=head1 NAME
-Moose::Meta::Attribute::Trait::Native::Counter
+Moose::Meta::Attribute::Native::Trait::Counter
=head1 SYNOPSIS
-package Moose::Meta::Attribute::Trait::Native::Hash;
+package Moose::Meta::Attribute::Native::Trait::Hash;
use Moose::Role;
our $VERSION = '0.87';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
-use Moose::Meta::Attribute::Trait::Native::MethodProvider::Hash;
+use Moose::Meta::Attribute::Native::MethodProvider::Hash;
-with 'Moose::Meta::Attribute::Trait::Native';
+with 'Moose::Meta::Attribute::Native::Trait';
has 'method_provider' => (
is => 'ro',
isa => 'ClassName',
predicate => 'has_method_provider',
- default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::Hash'
+ default => 'Moose::Meta::Attribute::Native::MethodProvider::Hash'
);
sub _helper_type { 'HashRef' }
=head1 NAME
-Moose::Meta::Attribute::Trait::Native::Hash
+Moose::Meta::Attribute::Native::Trait::Hash
=head1 SYNOPSIS
=head1 DESCRIPTION
This module provides a Hash attribute which provides a number of
-hash-like operations. See L<Moose::Meta::Attribute::Trait::Native::MethodProvider::Hash>
+hash-like operations. See L<Moose::Meta::Attribute::Native::MethodProvider::Hash>
for more details.
=head1 METHODS
-package Moose::Meta::Attribute::Trait::Native::Number;
+package Moose::Meta::Attribute::Native::Trait::Number;
use Moose::Role;
our $VERSION = '0.87';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
-with 'Moose::Meta::Attribute::Trait::Native';
+with 'Moose::Meta::Attribute::Native::Trait';
sub _helper_type { 'Num' }
=head1 NAME
-Moose::Meta::Attribute::Trait::Native::Number
+Moose::Meta::Attribute::Native::Trait::Number
=head1 SYNOPSIS
-package Moose::Meta::Attribute::Trait::Native::String;
+package Moose::Meta::Attribute::Native::Trait::String;
use Moose::Role;
our $VERSION = '0.87';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
-use Moose::Meta::Attribute::Trait::Native::MethodProvider::String;
+use Moose::Meta::Attribute::Native::MethodProvider::String;
-with 'Moose::Meta::Attribute::Trait::Native';
+with 'Moose::Meta::Attribute::Native::Trait';
has 'method_provider' => (
is => 'ro',
isa => 'ClassName',
predicate => 'has_method_provider',
- default => 'Moose::Meta::Attribute::Trait::Native::MethodProvider::String',
+ default => 'Moose::Meta::Attribute::Native::MethodProvider::String',
);
sub _default_default { q{} }
=head1 NAME
-Moose::Meta::Attribute::Trait::Native::String
+Moose::Meta::Attribute::Native::Trait::String
=head1 SYNOPSIS
# check the meta ..
my $counter = $page->meta->get_attribute('counter');
-does_ok( $counter, 'Moose::Meta::Attribute::Trait::Native::Counter' );
+does_ok( $counter, 'Moose::Meta::Attribute::Native::Trait::Counter' );
is( $counter->type_constraint->name, 'Num',
'... got the expected default type constraint' );
# check the meta ..
my $counter = $page->meta->get_attribute('counter');
-does_ok( $counter, 'Moose::Meta::Attribute::Trait::Native::Counter' );
+does_ok( $counter, 'Moose::Meta::Attribute::Native::Trait::Counter' );
is( $counter->type_constraint->name, 'Int',
'... got the expected type constraint' );
## test the meta
my $options = $stuff->meta->get_attribute('options');
-does_ok( $options, 'Moose::Meta::Attribute::Trait::Native::Array' );
+does_ok( $options, 'Moose::Meta::Attribute::Native::Trait::Array' );
is_deeply(
$options->handles,
## test the meta
my $options = $stuff->meta->get_attribute('options');
-does_ok( $options, 'Moose::Meta::Attribute::Trait::Native::Hash' );
+does_ok( $options, 'Moose::Meta::Attribute::Native::Trait::Hash' );
is_deeply(
$options->handles,
## test the meta
my $attr = $real->meta->get_attribute('integer');
-does_ok( $attr, 'Moose::Meta::Attribute::Trait::Native::Number' );
+does_ok( $attr, 'Moose::Meta::Attribute::Native::Trait::Number' );
is_deeply(
$attr->handles,
## test the meta
my $options = $stuff->meta->get_attribute('_options');
-does_ok( $options, 'Moose::Meta::Attribute::Trait::Native::Array' );
+does_ok( $options, 'Moose::Meta::Attribute::Native::Trait::Array' );
is_deeply(
$options->handles,
# check the meta ..
my $string = $page->meta->get_attribute('string');
-does_ok( $string, 'Moose::Meta::Attribute::Trait::Native::String' );
+does_ok( $string, 'Moose::Meta::Attribute::Native::Trait::String' );
is(
$string->type_constraint->name, 'Str',