| 1 | package Dancer::OO::Object; | ||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 2 | ▶ | use Dancer::OO::Dancer qw( debug ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | 2 | our $VERSION = '0.01'; | |||||||||||
| 6 | |||||||||||||
| 7 | # this module actually installs deferred and properly stacked uri handlers | ||||||||||||
| 8 | |||||||||||||
| 9 | 1 | ▶ | sub _build_tree { | ||||||||||
|
Subroutine
_build_tree: called CC=2 SCAR=7.1
| |||||||||||||
| 10 | 1 | my ($package) = @_; | |||||||||||
| 11 | 1 | ▶ | return unless $package; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 12 | 2 | ▶ | no strict 'refs'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 13 | 0 | return map { $_, _build_tree($_) } @{"$package\::ISA"}; | |||||||||||
| 14 | } | ||||||||||||
| 15 | |||||||||||||
| 16 | # delay declarations | ||||||||||||
| 17 | 1 | ▶ | sub import { | ||||||||||
|
Subroutine
import: called CC=6 SCAR=23.0
| |||||||||||||
| 18 | 1 | my ( $self, $prefix ) = @_; | |||||||||||
| 19 | 2 | ▶ | no strict 'refs'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 20 | 1 | ${"$self\::_prefix"} = $prefix; | |||||||||||
| 21 | 1 | my @tree = ($self, _build_tree($self)); | |||||||||||
| 22 | 1 | my %seen; | |||||||||||
| 23 | 1 | foreach my $isa (@tree) { | |||||||||||
| 24 | 1 | foreach ( @{ ${"$isa\::_handler"} } ) { | |||||||||||
| 25 | 0 | ▶ | my $path = join( '', $_->[0], $prefix, $_->[1] ) || '/'; | ||||||||||
|
Condition0%0/2
join('', $_->[0], $prefix, $_->[1]) || '/'
MC/DC0%0/1
join('', $_->[0], $prefix, $_->[1]) || '/'
join('', $_->[0], $prefix, $_->[1])
Truth table0%0/2
A
A= join('', $_->[0], $prefix, $_->[1])
| |||||||||||||
| 26 | 0 | ▶ | next if $seen{$path}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 27 | 0 | debug( 'for', $self, $_->[0], $prefix . $_->[1], 'in', $isa); | |||||||||||
| 28 | 0 | $seen{$path} = 1; | |||||||||||
| 29 | 0 | foreach my $handler (@Dancer::OO::Dancer::route_handler) { | |||||||||||
| 30 | 0 | &{"Dancer\::$handler"}( $prefix . $_->[1], $_->[2]->($self) ); | |||||||||||
| 31 | } | ||||||||||||
| 32 | } | ||||||||||||
| 33 | } | ||||||||||||
| 34 | } | ||||||||||||
| 35 | |||||||||||||
| 36 | =head1 NAME | ||||||||||||
| 37 | |||||||||||||
| 38 | Dancer::OO::Object - root object for all packages | ||||||||||||
| 39 | |||||||||||||
| 40 | =head1 VERSION | ||||||||||||
| 41 | |||||||||||||
| 42 | Version 0.01 | ||||||||||||
| 43 | |||||||||||||
| 44 | =cut | ||||||||||||
| 45 | |||||||||||||
| 46 | =head1 SYNOPSIS | ||||||||||||
| 47 | |||||||||||||
| 48 | use parent 'Dancer::OO::Object'; | ||||||||||||
| 49 | |||||||||||||
| 50 | =head1 EXPORT | ||||||||||||
| 51 | |||||||||||||
| 52 | =head1 SUBROUTINES/METHODS | ||||||||||||
| 53 | |||||||||||||
| 54 | =cut | ||||||||||||
| 55 | |||||||||||||
| 56 | =head1 AUTHOR | ||||||||||||
| 57 | |||||||||||||
| 58 | Roman Galeev, C<< <jamhedd at gmail.com> >> | ||||||||||||
| 59 | |||||||||||||
| 60 | =head1 BUGS | ||||||||||||
| 61 | |||||||||||||
| 62 | Please report any bugs or feature requests to C<bug-dancer-plugin-scoped at rt.cpan.org>, or through | ||||||||||||
| 63 | the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Dancer-OO-Object>. I will be notified, and then you'll | ||||||||||||
| 64 | automatically be notified of progress on your bug as I make changes. | ||||||||||||
| 65 | |||||||||||||
| 66 | =head1 SUPPORT | ||||||||||||
| 67 | |||||||||||||
| 68 | You can find documentation for this module with the perldoc command. | ||||||||||||
| 69 | |||||||||||||
| 70 | perldoc Dancer::OO::Object | ||||||||||||
| 71 | |||||||||||||
| 72 | You can also look for information at: | ||||||||||||
| 73 | |||||||||||||
| 74 | =over 4 | ||||||||||||
| 75 | |||||||||||||
| 76 | =item * RT: CPAN's request tracker | ||||||||||||
| 77 | |||||||||||||
| 78 | L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Dancer-OO-Object> | ||||||||||||
| 79 | |||||||||||||
| 80 | =item * AnnoCPAN: Annotated CPAN documentation | ||||||||||||
| 81 | |||||||||||||
| 82 | L<http://annocpan.org/dist/Dancer-OO-Object> | ||||||||||||
| 83 | |||||||||||||
| 84 | =item * CPAN Ratings | ||||||||||||
| 85 | |||||||||||||
| 86 | L<http://cpanratings.perl.org/d/Dancer-OO-Object> | ||||||||||||
| 87 | |||||||||||||
| 88 | =item * Search CPAN | ||||||||||||
| 89 | |||||||||||||
| 90 | L<http://search.cpan.org/dist/Dancer-OO-Object/> | ||||||||||||
| 91 | |||||||||||||
| 92 | =back | ||||||||||||
| 93 | |||||||||||||
| 94 | =head1 ACKNOWLEDGEMENTS | ||||||||||||
| 95 | |||||||||||||
| 96 | =head1 LICENSE AND COPYRIGHT | ||||||||||||
| 97 | |||||||||||||
| 98 | Copyright 2012 Roman Galeev. | ||||||||||||
| 99 | |||||||||||||
| 100 | This program is free software; you can redistribute it and/or modify it | ||||||||||||
| 101 | under the terms of either: the GNU General Public License as published | ||||||||||||
| 102 | by the Free Software Foundation; or the Artistic License. | ||||||||||||
| 103 | |||||||||||||
| 104 | See http://dev.perl.org/licenses/ for more information. | ||||||||||||
| 105 | |||||||||||||
| 106 | =cut | ||||||||||||
| 107 | |||||||||||||
| 108 | 2 | 1; # End of Dancer::OO::Object | |||||||||||