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   832 use Data::Hopen;
  2         5  
  2         157  
4 2     2   13 use strict;
  2         4  
  2         42  
5 2     2   9 use Data::Hopen::Base;
  2         5  
  2         13  
6              
7             our $VERSION = '0.000018';
8              
9 2     2   458 use parent 'Data::Hopen::G::Op';
  2         4  
  2         15  
10 2     2   143 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   2383 my $self = shift or croak 'Need an instance';
45 12 100       306 croak 'output is not a hashref' unless ref $self->output eq 'HASH';
46 11         244 return $self->output;
47             } #_run()
48              
49             1;
50             __END__