| 1 | # ABSTRACT: request - role - has data | ||||||||||||||||||||||||||||
| 2 | package PONAPI::Client::Request::Role::HasData; | ||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 2 | has _data => ( | |||||||||||||||||||||||||||
| 7 | init_arg => 'data', | ||||||||||||||||||||||||||||
| 8 | is => 'ro', | ||||||||||||||||||||||||||||
| 9 | isa => 'HashRef', | ||||||||||||||||||||||||||||
| 10 | required => 1, | ||||||||||||||||||||||||||||
| 11 | ); | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 2 | has data => ( | |||||||||||||||||||||||||||
| 14 | init_arg => undef, | ||||||||||||||||||||||||||||
| 15 | is => 'ro', | ||||||||||||||||||||||||||||
| 16 | isa => 'HashRef', | ||||||||||||||||||||||||||||
| 17 | lazy => 1, | ||||||||||||||||||||||||||||
| 18 | builder => '_build_data', | ||||||||||||||||||||||||||||
| 19 | ); | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | sub _build_data { | ||||||||||||||||||||||||||||
| 22 | 2 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
_build_data: called CC=4 SCAR=14.0
| |||||||||||||||||||||||||||||
| 23 | 2 | my $data = $self->_data; | |||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 2 | ▶ | $data->{type} = $self->type if !defined $data->{type}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 26 | $data->{id} = $self->id if !defined $data->{id} | ||||||||||||||||||||||||||||
| 27 | 2 | ▶ | && $self->does('PONAPI::Client::Request::Role::HasId'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not defined $data->{"id"} and $self->does("PONAPI::Client::Request::Role::HasId")
MC/DC50%1/2
not defined $data->{"id"} and $self->does("PONAPI::Client::Request::Role::HasId")
not defined $data->{"id"}
$self->does("PONAPI::Client::Request::Role::HasId")
Truth table66%2/3
not(A) and B
A= not defined $data->{"id"}B= $self->does("PONAPI::Client::Request::Role::HasId")
| |||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 2 | return $data; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 2 | ▶ | no Moose::Role; 1; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | __END__ | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | =pod | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | =encoding UTF-8 | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | =head1 NAME | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | PONAPI::Client::Request::Role::HasData - request - role - has data | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | =head1 VERSION | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | version 0.002003 | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | =head1 AUTHORS | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | =over 4 | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | =item * | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | Mickey Nasriachi <mickey@cpan.org> | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | =item * | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | Stevan Little <stevan@cpan.org> | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | =item * | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | Brian Fraser <hugmeir@cpan.org> | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | =back | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | This software is copyright (c) 2016 by Mickey Nasriachi, Stevan Little, Brian Fraser. | ||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||
| 71 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | =cut | ||||||||||||||||||||||||||||