File Coverage

blib/lib/App/HL7/Compare/Parser/Role/RequiresInput.pm
Criterion Covered Total %
statement 25 25 100.0
branch 1 2 50.0
condition n/a
subroutine 8 8 100.0
pod 0 1 0.0
total 34 36 94.4


line stmt bran cond sub pod time code
1             package App::HL7::Compare::Parser::Role::RequiresInput;
2             $App::HL7::Compare::Parser::Role::RequiresInput::VERSION = '0.004';
3 4     4   2723 use v5.10;
  4         18  
4 4     4   24 use strict;
  4         10  
  4         126  
5 4     4   34 use warnings;
  4         76  
  4         336  
6              
7 4     4   27 use Mooish::AttributeBuilder -standard;
  4         9  
  4         36  
8 4     4   513 use Types::Standard qw(Str);
  4         9  
  4         30  
9 4     4   8736 use App::HL7::Compare::Exception;
  4         15  
  4         150  
10 4     4   27 use Moo::Role;
  4         7  
  4         26  
11              
12             has param 'input' => (
13             isa => Str,
14             writer => -hidden,
15             predicate => -hidden,
16             clearer => -hidden,
17             );
18              
19             sub consume_input
20             {
21 248     248 0 401 my ($self) = @_;
22              
23 248 50       697 App::HL7::Compare::Exception->raise('input already consumed')
24             unless $self->_has_input;
25              
26 248         459 my $input = $self->input;
27 248         4558 $self->_clear_input;
28              
29 248         1855 return $input;
30             }
31              
32             1;
33