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   3399 use strict;
  9         21  
  9         275  
4 9     9   47 use Data::Hopen::Base;
  9         22  
  9         54  
5              
6             our $VERSION = '0.000018';
7              
8 9     9   2092 use parent 'Data::Hopen::G::Runnable';
  9         19  
  9         46  
9             use Class::Tiny {
10 9         49 greedy => 0
11 9     9   478 };
  9         18  
12              
13 9     9   1981 use Data::Hopen qw(:default UNSPECIFIED);
  9         20  
  9         1482  
14 9     9   66 use Data::Hopen::Util::Data qw(clone);
  9         25  
  9         1644  
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         89 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 7107 my ($self, $args) = @_;
55 12 100       60 $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__