AutoCRUD/View/Xml.pm

filter: Statementstmt 100% 31 / 31 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 0.0% 0 / 1 totaltotal 97.6% 41 / 42 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« AutoCRUD/View/Redirect.pm ↑ Summary AutoCRUD/Controller/Home.pm »
1 package App::AutoCRUD::View::Xml;
2
3 1 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6
7 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 extends 'App::AutoCRUD::View';
9
10 1 ▶use XML::Simple qw/XMLout/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Encode qw/encode_utf8/;
Subroutine BEGIN: called CC=1 SCAR=0.0
12
13 1 ▶use namespace::clean -except => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
14
15 has 'xml_options' => ( is => 'bare', isa => 'HashRef',
16 1 ▶ default => sub {{
Subroutine __ANON__: called CC=1 SCAR=0.0
17 1 KeepRoot => 1,
18 SuppressEmpty => 1,
19 XMLDecl => "<?xml version='1.0' encoding='UTF-8'?>",
20 1 }} );
21
22 1 ▶sub render {
Subroutine render: called CC=1 SCAR=0.0
Pod undocumented
23 1 my ($self, $data, $context) = @_;
24
25 1 ▶ no warnings 'uninitialized';
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 my $xml = XMLout({data => $data}, %{$self->{xml_options}});
27
28 1 return [200, ['Content-type' => 'text/xml'], [encode_utf8($xml)] ];
29 }
30
31 1 1;
32
33
34 __END__
« AutoCRUD/View/Redirect.pm ↑ Summary AutoCRUD/Controller/Home.pm »