File Coverage

blib/lib/Data/Sah/Coerce/perl/To_str/From_str/to_upper.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 2 0.0
total 20 22 90.9


line stmt bran cond sub pod time code
1             package Data::Sah::Coerce::perl::To_str::From_str::to_upper;
2              
3             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
4             our $DATE = '2020-02-11'; # DATE
5             our $DIST = 'Data-Sah-Coerce-perl-To_str-From_str-to_upper'; # DIST
6             our $VERSION = '0.007'; # VERSION
7              
8 1     1   2124 use 5.010001;
  1         5  
9 1     1   6 use strict;
  1         2  
  1         22  
10 1     1   5 use warnings;
  1         2  
  1         170  
11              
12             sub meta {
13             +{
14 1     1 0 14 v => 4,
15             summary => '(DEPRECATED) Coerce string to upper case',
16             prio => 50,
17             };
18             }
19              
20             sub coerce {
21 1     1 0 17 my %args = @_;
22              
23 1         3 my $dt = $args{data_term};
24              
25 1         2 my $res = {};
26              
27 1         3 $res->{expr_match} = "!ref($dt)";
28 1         3 $res->{expr_coerce} = join(
29             "",
30             "uc($dt)",
31             );
32              
33 1         4 $res;
34             }
35              
36             1;
37             # ABSTRACT: (DEPRECATED) Coerce string to upper case
38              
39             __END__
40              
41             =pod
42              
43             =encoding UTF-8
44              
45             =head1 NAME
46              
47             Data::Sah::Coerce::perl::To_str::From_str::to_upper - (DEPRECATED) Coerce string to upper case
48              
49             =head1 VERSION
50              
51             This document describes version 0.007 of Data::Sah::Coerce::perl::To_str::From_str::to_upper (from Perl distribution Data-Sah-Coerce-perl-To_str-From_str-to_upper), released on 2020-02-11.
52              
53             =head1 SYNOPSIS
54              
55             To use in a Sah schema:
56              
57             ["str",{"x.perl.coerce_rules"=>["From_str::to_upper"]}]
58              
59             =head1 DESCRIPTION
60              
61             DEPRECATION NOTICE: Using L<Data::Sah::Filter::perl::Str::upcase> is now more
62             appropriate as multiple filters can be applied to data.
63              
64             =for Pod::Coverage ^(meta|coerce)$
65              
66             =head1 HOMEPAGE
67              
68             Please visit the project's homepage at L<https://metacpan.org/release/Data-Sah-Coerce-perl-To_str-From_str-to_upper>.
69              
70             =head1 SOURCE
71              
72             Source repository is at L<https://github.com/perlancar/perl-Data-Sah-Coerce-perl-To_str-From_str-to_upper>.
73              
74             =head1 BUGS
75              
76             Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Sah-Coerce-perl-To_str-From_str-to_upper>
77              
78             When submitting a bug or request, please include a test-file or a
79             patch to an existing test-file that illustrates the bug or desired
80             feature.
81              
82             =head1 AUTHOR
83              
84             perlancar <perlancar@cpan.org>
85              
86             =head1 COPYRIGHT AND LICENSE
87              
88             This software is copyright (c) 2020, 2019, 2018 by perlancar@cpan.org.
89              
90             This is free software; you can redistribute it and/or modify it under
91             the same terms as the Perl 5 programming language system itself.
92              
93             =cut