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.001';
3 3     3   1797 use v5.10;
  3         12  
4 3     3   18 use strict;
  3         7  
  3         62  
5 3     3   16 use warnings;
  3         7  
  3         111  
6              
7 3     3   18 use Mooish::AttributeBuilder -standard;
  3         32  
  3         35  
8 3     3   361 use Types::Standard qw(Str);
  3         8  
  3         22  
9 3     3   5649 use App::HL7::Compare::Exception;
  3         13  
  3         99  
10 3     3   20 use Moo::Role;
  3         6  
  3         59  
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 168     168 0 277 my ($self) = @_;
22              
23 168 50       456 App::HL7::Compare::Exception->raise('input already consumed')
24             unless $self->_has_input;
25              
26 168         335 my $input = $self->input;
27 168         2837 $self->_clear_input;
28              
29 168         1464 return $input;
30             }
31              
32             1;
33