File Coverage

blib/lib/Data/Hopen/G/Link.pm
Criterion Covered Total %
statement 22 22 100.0
branch 2 2 100.0
condition n/a
subroutine 8 8 100.0
pod 1 1 100.0
total 33 33 100.0


line stmt bran cond sub pod time code
1             # Data::Hopen::G::Link - base class for hopen edges
2             package Data::Hopen::G::Link;
3 9     9   3400 use strict;
  9         20  
  9         287  
4 9     9   56 use Data::Hopen::Base;
  9         17  
  9         55  
5              
6             our $VERSION = '0.000017';
7              
8 9     9   2136 use parent 'Data::Hopen::G::Runnable';
  9         20  
  9         45  
9             use Class::Tiny {
10 9         46 greedy => 0
11 9     9   491 };
  9         19  
12              
13 9     9   1931 use Data::Hopen qw(:default UNSPECIFIED);
  9         23  
  9         993  
14 9     9   62 use Data::Hopen::Util::Data qw(clone);
  9         32  
  9         1723  
15              
16             =head1 NAME
17              
18             Data::Hopen::G::Link - The base class for all hopen links between ops.
19              
20             =head1 VARIABLES
21              
22             =head2 greedy
23              
24             If set truthy in the C call, the edge will ask for all inputs.
25              
26             =head1 FUNCTIONS
27              
28             =head2 run
29              
30             Copy the inputs to the outputs.
31              
32             my $hrOutputs = $op->run($scope)
33              
34             The output is C<{}> if no inputs are provided.
35              
36             By default, the output is a copy of the inputs
37             (see L).
38              
39             =cut
40              
41             sub _run {
42 2     2   12 my ($self, %args) = getparameters('self', [qw(; phase visitor)], @_);
43 2         92 return $self->passthrough(-nocontext => 1);
44             } #run()
45              
46              
47             =head2 BUILD
48              
49             Constructor. Interprets L.
50              
51             =cut
52              
53             sub BUILD {
54 12     12 1 8954 my ($self, $args) = @_;
55 12 100       65 $self->want(UNSPECIFIED) if $args->{greedy};
56             #hlog { 'Link::BUILD', Dumper($self), Dumper($args) };
57             #hlog { 'Link::BUILD', Dumper($self->scope) };
58             } #BUILD()
59              
60             1;
61             __END__