File Coverage

blib/lib/Search/Elasticsearch/Serializer/JSON/XS.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             # Licensed to Elasticsearch B.V. under one or more contributor
2             # license agreements. See the NOTICE file distributed with
3             # this work for additional information regarding copyright
4             # ownership. Elasticsearch B.V. licenses this file to you under
5             # the Apache License, Version 2.0 (the "License"); you may
6             # not use this file except in compliance with the License.
7             # You may obtain a copy of the License at
8             #
9             # http://www.apache.org/licenses/LICENSE-2.0
10             #
11             # Unless required by applicable law or agreed to in writing,
12             # software distributed under the License is distributed on an
13             # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14             # KIND, either express or implied. See the License for the
15             # specific language governing permissions and limitations
16             # under the License.
17              
18             package Search::Elasticsearch::Serializer::JSON::XS;
19             $Search::Elasticsearch::Serializer::JSON::XS::VERSION = '8.00';
20 3     3   1346 use Moo;
  3         6  
  3         17  
21 3     3   969 use JSON::XS 2.26;
  3         87  
  3         327  
22              
23             has 'JSON' => ( is => 'ro', default => sub { JSON::XS->new->utf8(1) } );
24              
25             with 'Search::Elasticsearch::Role::Serializer::JSON';
26              
27             1;
28              
29             =pod
30              
31             =encoding UTF-8
32              
33             =head1 NAME
34              
35             Search::Elasticsearch::Serializer::JSON::XS - A JSON Serializer using JSON::XS
36              
37             =head1 VERSION
38              
39             version 8.00
40              
41             =head1 SYNOPSIS
42              
43             $e = Search::Elasticsearch(
44             serializer => 'JSON::XS'
45             );
46              
47             =head1 DESCRIPTION
48              
49             While the default serializer, L,
50             tries to choose the appropriate JSON backend, this module allows you to
51             choose the L backend specifically.
52              
53             This class does L.
54              
55             =head1 SEE ALSO
56              
57             =over
58              
59             =item * L
60              
61             =item * L
62              
63             =item * L
64              
65             =back
66              
67             =head1 AUTHOR
68              
69             Enrico Zimuel
70              
71             =head1 COPYRIGHT AND LICENSE
72              
73             This software is Copyright (c) 2022 by Elasticsearch BV.
74              
75             This is free software, licensed under:
76              
77             The Apache License, Version 2.0, January 2004
78              
79             =cut
80              
81             __END__