Class-XSConstructor
view release on metacpan or search on metacpan
t/bug-moosex.t view on Meta::CPAN
};
BEGIN {
package Local::XS;
use Moose;
use MooseX::XSAccessor;
use MooseX::XSConstructor;
use Types::Common -types;
has n => ( is => 'ro', isa => Int, required => 1 );
has children => ( is => 'ro', isa => ArrayRef, lazy => 1, builder => '_build_children' );
has sum => ( is => 'ro', isa => Int, lazy => 1, builder => '_build_sum' );
sub _build_children {
my $self = shift;
return [] if $self->n < 1;
my @kids = map {
my $n = $_;
__PACKAGE__->new( n => $n );
} 0 .. $self->n - 1;
( run in 1.207 second using v1.01-cache-2.11-cpan-39bf76dae61 )