| Filename | /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/MooseX/StrictConstructor/Role/Object.pm |
| Statements | Executed 15 statements in 1.23ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 119µs | 187µs | MooseX::StrictConstructor::Role::Object::BEGIN@7 |
| 1 | 1 | 1 | 49µs | 49µs | MooseX::StrictConstructor::Role::Object::BEGIN@2 |
| 1 | 1 | 1 | 46µs | 669µs | MooseX::StrictConstructor::Role::Object::BEGIN@32 |
| 1 | 1 | 1 | 41µs | 14.5ms | MooseX::StrictConstructor::Role::Object::BEGIN@9 |
| 1 | 1 | 1 | 39µs | 57µs | MooseX::StrictConstructor::Role::Object::BEGIN@6 |
| 0 | 0 | 0 | 0s | 0s | MooseX::StrictConstructor::Role::Object::__ANON__[:30] |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package MooseX::StrictConstructor::Role::Object; | ||||
| 2 | # spent 49µs within MooseX::StrictConstructor::Role::Object::BEGIN@2 which was called:
# once (49µs+0s) by MooseX::StrictConstructor::BEGIN@12 at line 4 | ||||
| 3 | 1 | 24µs | $MooseX::StrictConstructor::Role::Object::VERSION = '0.11'; | ||
| 4 | 1 | 79µs | 1 | 49µs | } # spent 49µs making 1 call to MooseX::StrictConstructor::Role::Object::BEGIN@2 |
| 5 | |||||
| 6 | 3 | 157µs | 2 | 75µs | # spent 57µs (39+18) within MooseX::StrictConstructor::Role::Object::BEGIN@6 which was called:
# once (39µs+18µs) by MooseX::StrictConstructor::BEGIN@12 at line 6 # spent 57µs making 1 call to MooseX::StrictConstructor::Role::Object::BEGIN@6
# spent 18µs making 1 call to strict::import |
| 7 | 3 | 114µs | 2 | 255µs | # spent 187µs (119+68) within MooseX::StrictConstructor::Role::Object::BEGIN@7 which was called:
# once (119µs+68µs) by MooseX::StrictConstructor::BEGIN@12 at line 7 # spent 187µs making 1 call to MooseX::StrictConstructor::Role::Object::BEGIN@7
# spent 68µs making 1 call to warnings::import |
| 8 | |||||
| 9 | 3 | 672µs | 2 | 29.0ms | # spent 14.5ms (41µs+14.5) within MooseX::StrictConstructor::Role::Object::BEGIN@9 which was called:
# once (41µs+14.5ms) by MooseX::StrictConstructor::BEGIN@12 at line 9 # spent 14.5ms making 1 call to MooseX::StrictConstructor::Role::Object::BEGIN@9
# spent 14.5ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:456] |
| 10 | |||||
| 11 | after 'BUILDALL' => sub { | ||||
| 12 | my $self = shift; | ||||
| 13 | my $params = shift; | ||||
| 14 | |||||
| 15 | my %attrs = ( | ||||
| 16 | __INSTANCE__ => 1, | ||||
| 17 | map { $_ => 1 } | ||||
| 18 | grep {defined} | ||||
| 19 | map { $_->init_arg() } $self->meta()->get_all_attributes() | ||||
| 20 | ); | ||||
| 21 | |||||
| 22 | my @bad = sort grep { !$attrs{$_} } keys %{$params}; | ||||
| 23 | |||||
| 24 | if (@bad) { | ||||
| 25 | confess | ||||
| 26 | "Found unknown attribute(s) init_arg passed to the constructor: @bad"; | ||||
| 27 | } | ||||
| 28 | |||||
| 29 | return; | ||||
| 30 | 1 | 22µs | 1 | 352µs | }; # spent 352µs making 1 call to Moose::Role::after |
| 31 | |||||
| 32 | 3 | 139µs | 2 | 1.29ms | # spent 669µs (46+623) within MooseX::StrictConstructor::Role::Object::BEGIN@32 which was called:
# once (46µs+623µs) by MooseX::StrictConstructor::BEGIN@12 at line 32 # spent 669µs making 1 call to MooseX::StrictConstructor::Role::Object::BEGIN@32
# spent 623µs making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:557] |
| 33 | |||||
| 34 | 1 | 26µs | 1; | ||
| 35 | |||||
| 36 | # ABSTRACT: A role which implements a strict constructor for Moose::Object | ||||
| 37 | |||||
| - - | |||||
| 40 | =pod | ||||
| 41 | |||||
| - - | |||||
| 80 | __END__ |