| 1 | # | ||||||||||
| 2 | # This file is part of MooseX-Attribute-Deflator | ||||||||||
| 3 | # | ||||||||||
| 4 | # This software is Copyright (c) 2012 by Moritz Onken. | ||||||||||
| 5 | # | ||||||||||
| 6 | # This is free software, licensed under: | ||||||||||
| 7 | # | ||||||||||
| 8 | # The (three-clause) BSD License | ||||||||||
| 9 | # | ||||||||||
| 10 | package MooseX::Attribute::LazyInflator::Meta::Role::Method::Constructor; | ||||||||||
| 11 | { | ||||||||||
| 12 | 1 | $MooseX::Attribute::LazyInflator::Meta::Role::Method::Constructor::VERSION = '2.2.2'; | |||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | # ABSTRACT: Lazy inflate attributes | ||||||||||
| 16 | 1 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | |||||||||||
| 20 | 0 | ▶ | override _generate_type_constraint_check => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 21 | 0 | my $self = shift; | |||||||||
| 22 | 0 | return $self->_generate_skip_coercion_and_constraint($_[0], super); | |||||||||
| 23 | 1 | }; | |||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub _generate_skip_coercion_and_constraint { | ||||||||
|
Subroutine
_generate_skip_coercion_and_constraint: not called CC=2 SCAR=17.9
| |||||||||||
| 26 | 0 | my ($self, $attr, $code) = @_; | |||||||||
| 27 | 0 | ▶ | if($attr->does('MooseX::Attribute::LazyInflator::Meta::Role::Attribute')) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 0 | return ''; | |||||||||
| 29 | } | ||||||||||
| 30 | 0 | return $code; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 1 | 1; | |||||||||
| 34 | |||||||||||
| 35 | |||||||||||
| 36 | |||||||||||
| 37 | =pod | ||||||||||
| 38 | |||||||||||
| 39 | =head1 NAME | ||||||||||
| 40 | |||||||||||
| 41 | MooseX::Attribute::LazyInflator::Meta::Role::Method::Constructor - Lazy inflate attributes | ||||||||||
| 42 | |||||||||||
| 43 | =head1 VERSION | ||||||||||
| 44 | |||||||||||
| 45 | version 2.2.2 | ||||||||||
| 46 | |||||||||||
| 47 | =head1 METHODS | ||||||||||
| 48 | |||||||||||
| 49 | =over 8 | ||||||||||
| 50 | |||||||||||
| 51 | =item override B<_generate_type_constraint_check> | ||||||||||
| 52 | |||||||||||
| 53 | =item B<_generate_skip_coercion_and_constraint> | ||||||||||
| 54 | |||||||||||
| 55 | Type constraint verification is not processed if the | ||||||||||
| 56 | attribute has not been inflated yet. | ||||||||||
| 57 | |||||||||||
| 58 | =back | ||||||||||
| 59 | |||||||||||
| 60 | =head1 AUTHOR | ||||||||||
| 61 | |||||||||||
| 62 | Moritz Onken | ||||||||||
| 63 | |||||||||||
| 64 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 65 | |||||||||||
| 66 | This software is Copyright (c) 2012 by Moritz Onken. | ||||||||||
| 67 | |||||||||||
| 68 | This is free software, licensed under: | ||||||||||
| 69 | |||||||||||
| 70 | The (three-clause) BSD License | ||||||||||
| 71 | |||||||||||
| 72 | =cut | ||||||||||
| 73 | |||||||||||
| 74 | |||||||||||
| 75 | __END__ | ||||||||||