| 1 | package Pipeline::Production; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use warnings::register; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 3 | ▶ | use Pipeline::Base; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 3 | ▶ | use base qw( Pipeline::Base ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 3 | our $VERSION = "3.12"; | |||||||||
| 10 | |||||||||||
| 11 | 3 | ▶ | sub init { | ||||||||
|
Subroutine
init: called CC=2 SCAR=7.4
Pod
documented
| |||||||||||
| 12 | 3 | my $self = shift; | |||||||||
| 13 | 3 | ▶ | if ($self->SUPER::init( @_ )) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 3 | $self->contents( '' ); | |||||||||
| 15 | 3 | return 1; | |||||||||
| 16 | } else { | ||||||||||
| 17 | 0 | return 0; | |||||||||
| 18 | } | ||||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 14 | ▶ | sub contents { | ||||||||
|
Subroutine
contents: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 22 | 14 | my $self = shift; | |||||||||
| 23 | 14 | $self->contains( @_ ); | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 14 | ▶ | sub contains { | ||||||||
|
Subroutine
contains: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 27 | 14 | my $self = shift; | |||||||||
| 28 | 14 | my $cont = shift; | |||||||||
| 29 | 14 | ▶ | if (defined( $cont )) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 6 | $self->{ production_contains } = $cont; | |||||||||
| 31 | 6 | return $self; | |||||||||
| 32 | } else { | ||||||||||
| 33 | 8 | return $self->{ production_contains }; | |||||||||
| 34 | } | ||||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 3 | 1; | |||||||||
| 38 | |||||||||||
| 39 | |||||||||||
| 40 | =head1 NAME | ||||||||||
| 41 | |||||||||||
| 42 | Pipeline::Production - wrapper for production objects | ||||||||||
| 43 | |||||||||||
| 44 | =head1 SYNOPSIS | ||||||||||
| 45 | |||||||||||
| 46 | use Pipeline::Production; | ||||||||||
| 47 | |||||||||||
| 48 | my $pp = Pipeline::Production->new(); | ||||||||||
| 49 | |||||||||||
| 50 | $pp->contents( $object ); | ||||||||||
| 51 | my $production = $pp->contents(); | ||||||||||
| 52 | |||||||||||
| 53 | =head1 DESCRIPTION | ||||||||||
| 54 | |||||||||||
| 55 | The C<Pipeline::Production> class acts as a wrapper around any scalar | ||||||||||
| 56 | (and therfore object, or reference) that a Pipeline is to consider as | ||||||||||
| 57 | a production. A production object will terminate the pipeline apon receipt | ||||||||||
| 58 | and cause the cleanup segments to be executed. | ||||||||||
| 59 | |||||||||||
| 60 | =head1 METHODS | ||||||||||
| 61 | |||||||||||
| 62 | =over 4 | ||||||||||
| 63 | |||||||||||
| 64 | =item new() | ||||||||||
| 65 | |||||||||||
| 66 | The C<new> method constructs a fresh Pipeline::Production object and | ||||||||||
| 67 | returns it. In the process it calls the C<init()> method. | ||||||||||
| 68 | |||||||||||
| 69 | =item init() | ||||||||||
| 70 | |||||||||||
| 71 | The C<init> method is called at construction time to perform any pre-use | ||||||||||
| 72 | initialization on the object. | ||||||||||
| 73 | |||||||||||
| 74 | =item contents( [ SCALAR ] ) | ||||||||||
| 75 | |||||||||||
| 76 | The C<contents> method gets or sets the contents of the production, ie, the | ||||||||||
| 77 | actual production itself. | ||||||||||
| 78 | |||||||||||
| 79 | =item contains( [ SCALAR ] ) | ||||||||||
| 80 | |||||||||||
| 81 | A synonym for C<contents> | ||||||||||
| 82 | |||||||||||
| 83 | =back | ||||||||||
| 84 | |||||||||||
| 85 | =head1 SEE ALSO | ||||||||||
| 86 | |||||||||||
| 87 | C<Pipeline> | ||||||||||
| 88 | |||||||||||
| 89 | =head1 AUTHOR | ||||||||||
| 90 | |||||||||||
| 91 | James A. Duncan <jduncan@fotango.com> | ||||||||||
| 92 | |||||||||||
| 93 | =head1 COPYRIGHT | ||||||||||
| 94 | |||||||||||
| 95 | Copyright 2003 Fotango Ltd. All Rights Reserved. | ||||||||||
| 96 | |||||||||||
| 97 | This software is released under the same terms as Perl itself. | ||||||||||
| 98 | |||||||||||
| 99 | =cut | ||||||||||
| 100 | |||||||||||