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.002';
3 4     4   2378 use v5.10;
  4         21  
4 4     4   23 use strict;
  4         11  
  4         86  
5 4     4   20 use warnings;
  4         8  
  4         161  
6              
7 4     4   29 use Mooish::AttributeBuilder -standard;
  4         36  
  4         54  
8 4     4   500 use Types::Standard qw(Str);
  4         9  
  4         25  
9 4     4   7555 use App::HL7::Compare::Exception;
  4         10  
  4         141  
10 4     4   30 use Moo::Role;
  4         9  
  4         53  
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 190     190 0 313 my ($self) = @_;
22              
23 190 50       532 App::HL7::Compare::Exception->raise('input already consumed')
24             unless $self->_has_input;
25              
26 190         386 my $input = $self->input;
27 190         3181 $self->_clear_input;
28              
29 190         1721 return $input;
30             }
31              
32             1;
33