File Coverage

blib/lib/Data/Sah/Coerce/perl/To_str/From_str/ToLowerFirst.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::ToLowerFirst;
2              
3             # AUTHOR
4             our $DATE = '2019-11-28'; # DATE
5             our $DIST = 'Data-Sah-Coerce-perl-To_str-From_str-ToUpper'; # DIST
6             our $VERSION = '0.005'; # VERSION
7              
8 1     1   3688 use 5.010001;
  1         4  
9 1     1   4 use strict;
  1         3  
  1         19  
10 1     1   5 use warnings;
  1         1  
  1         130  
11              
12             sub meta {
13             +{
14 1     1 0 12 v => 4,
15             summary => "Coerce string's first character to lower case",
16             prio => 50,
17             };
18             }
19              
20             sub coerce {
21 1     1 0 15 my %args = @_;
22              
23 1         3 my $dt = $args{data_term};
24              
25 1         1 my $res = {};
26              
27 1         3 $res->{expr_match} = "!ref($dt)";
28 1         2 $res->{expr_coerce} = join(
29             "",
30             "lcfirst($dt)",
31             );
32              
33 1         4 $res;
34             }
35              
36             1;
37             # ABSTRACT: Coerce string's first character to lower 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::ToLowerFirst - Coerce string's first character to lower case
48              
49             =head1 VERSION
50              
51             This document describes version 0.005 of Data::Sah::Coerce::perl::To_str::From_str::ToLowerFirst (from Perl distribution Data-Sah-Coerce-perl-To_str-From_str-ToUpper), released on 2019-11-28.
52              
53             =head1 SYNOPSIS
54              
55             To use in a Sah schema:
56              
57             ["str",{"x.perl.coerce_rules"=>["From_str::ToLowerFirst"]}]
58              
59             =for Pod::Coverage ^(meta|coerce)$
60              
61             =head1 HOMEPAGE
62              
63             Please visit the project's homepage at L<https://metacpan.org/release/Data-Sah-Coerce-perl-To_str-From_str-ToUpper>.
64              
65             =head1 SOURCE
66              
67             Source repository is at L<https://github.com/perlancar/perl-Data-Sah-Coerce-perl-To_str-From_str-ToUpper>.
68              
69             =head1 BUGS
70              
71             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-ToUpper>
72              
73             When submitting a bug or request, please include a test-file or a
74             patch to an existing test-file that illustrates the bug or desired
75             feature.
76              
77             =head1 AUTHOR
78              
79             perlancar <perlancar@cpan.org>
80              
81             =head1 COPYRIGHT AND LICENSE
82              
83             This software is copyright (c) 2019, 2018 by perlancar@cpan.org.
84              
85             This is free software; you can redistribute it and/or modify it under
86             the same terms as the Perl 5 programming language system itself.
87              
88             =cut