File Coverage

blib/lib/App/HL7/Compare/Parser/Subcomponent.pm
Criterion Covered Total %
statement 19 21 90.4
branch n/a
condition n/a
subroutine 7 8 87.5
pod 0 1 0.0
total 26 30 86.6


line stmt bran cond sub pod time code
1             package App::HL7::Compare::Parser::Subcomponent;
2             $App::HL7::Compare::Parser::Subcomponent::VERSION = '0.001';
3 3     3   55 use v5.10;
  3         15  
4 3     3   17 use strict;
  3         7  
  3         60  
5 3     3   15 use warnings;
  3         5  
  3         64  
6              
7 3     3   13 use Moo;
  3         7  
  3         23  
8 3     3   989 use Mooish::AttributeBuilder -standard;
  3         13  
  3         19  
9 3     3   349 use Types::Standard qw(Str);
  3         6  
  3         23  
10              
11             has field 'value' => (
12             isa => Str,
13             lazy => 1,
14             );
15              
16             with qw(
17             App::HL7::Compare::Parser::Role::Part
18             App::HL7::Compare::Parser::Role::RequiresInput
19             App::HL7::Compare::Parser::Role::Stringifies
20             );
21              
22             sub _build_value
23             {
24 34     34   321 my ($self) = @_;
25              
26             # TODO: unescape HL7 parts
27 34         79 return $self->consume_input;
28             }
29              
30             sub to_string
31             {
32 0     0 0   my ($self) = @_;
33              
34             # TODO: escape HL7 parts
35 0           return $self->value;
36             }
37              
38             1;
39