File Coverage

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 3     3   3740 use Data::Hopen;
  3         8  
  3         279  
4 3     3   18 use strict;
  3         59  
  3         124  
5 3     3   17 use Data::Hopen::Base;
  3         6  
  3         19  
6              
7             our $VERSION = '0.000021';
8              
9 3     3   839 use parent 'Data::Hopen::G::Op';
  3         7  
  3         21  
10 3     3   206 use Class::Tiny qw(output);
  3         8  
  3         17  
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   2039 my $self = shift or croak 'Need an instance';
45 12 100       446 croak 'output is not a hashref' unless ref $self->output eq 'HASH';
46 11         309 return $self->output;
47             } #_run()
48              
49             1;
50             __END__