File Coverage

blib/lib/Data/Hopen/G/OutputOp.pm
Criterion Covered Total %
statement 18 18 100.0
branch 4 4 100.0
condition n/a
subroutine 6 6 100.0
pod n/a
total 28 28 100.0


line stmt bran cond sub pod time code
1             # Data::Hopen::G::OutputOp - operation with a fixed output
2             package Data::Hopen::G::OutputOp;
3 2     2   867 use Data::Hopen;
  2         4  
  2         141  
4 2     2   13 use strict;
  2         4  
  2         49  
5 2     2   12 use Data::Hopen::Base;
  2         3  
  2         16  
6              
7             our $VERSION = '0.000017';
8              
9 2     2   491 use parent 'Data::Hopen::G::Op';
  2         7  
  2         353  
10 2     2   154 use Class::Tiny qw(output);
  2         5  
  2         12  
11              
12             # Docs {{{1
13              
14             =head1 NAME
15              
16             Data::Hopen::G::OutputOp - operation with a fixed output
17              
18             =head1 SYNOPSIS
19              
20             This is a L that simply outputs a fixed value you
21             provide. Usage:
22              
23             my $op = Data::Hopen::G::OutputOp(output => { foo => 42, bar => 1337 });
24              
25             =head1 MEMBERS
26              
27             =head2 output
28              
29             A hashref that will be the output.
30              
31             =cut
32              
33             # }}}1
34              
35             =head1 FUNCTIONS
36              
37             =head2 _run
38              
39             Implementation of L.
40              
41             =cut
42              
43             sub _run {
44 13 100   13   2330 my $self = shift or croak 'Need an instance';
45 12 100       330 croak 'output is not a hashref' unless ref $self->output eq 'HASH';
46 11         268 return $self->output;
47             } #_run()
48              
49             1;
50             __END__