blib/lib/TableData/Size/Mattress.pm

filter: Statementstmt 94.1% 16 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 86.3% 19 / 22 SCAR 0.0
CC
1
Cov
94%
get_table_def
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 package TableData::Size::Mattress;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
7 1 our $DATE = '2023-06-13'; # DATE
8 1 our $DIST = 'TableData-Size-Mattress'; # DIST
9 1 our $VERSION = '0.001'; # VERSION
10  
11 1 ▶use Role::Tiny::With;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 with 'TableDataRole::Source::CSVInDATA';
13 1 with 'TableDataRole::Spec::TableDef';
14  
15 sub get_table_def {
16 return +{
17 0 ▶ fields => {
Subroutine get_table_def: not called CC=1 SCAR=6.9
Pod undocumented
18 name => {pos=>0, schema=>'str*'},
19 summary => {pos=>1, schema=>'str*'},
20 width => {pos=>2, summary=>'Width, in cm', schema=>'posfloat*'},
21 length => {pos=>3, summary=>'Length, in cm', schema=>'posfloat*'},
22 },
23 pk => 'name',
24 };
25 }
26  
27 # STATS
28  
29 1 1;
30 # ABSTRACT: Mattress sizes
31  
32 =pod
33  
34 =encoding UTF-8
35  
36 =head1 NAME
37  
38 TableData::Size::Mattress - Mattress sizes
39  
40 =head1 VERSION
41  
42 This document describes version 0.001 of TableData::Size::Mattress (from Perl distribution TableData-Size-Mattress), released on 2023-06-13.
43  
44 =head1 SYNOPSIS
45  
46 To use from Perl code:
47  
48 use TableData::Size::Mattress;
49  
50 my $td = TableData::Size::Mattress->new;
51  
52 # Iterate rows of the table
53 $td->each_row_arrayref(sub { my $row = shift; ... });
54 $td->each_row_hashref (sub { my $row = shift; ... });
55  
56 # Get the list of column names
57 my @columns = $td->get_column_names;
58  
59 # Get the number of rows
60 my $row_count = $td->get_row_count;
61  
62 See also L<TableDataRole::Spec::Basic> for other methods.
63  
64 To use from command-line (using L<tabledata> CLI):
65  
66 # Display as ASCII table and view with pager
67 % tabledata Size::Mattress --page
68  
69 # Get number of rows
70 % tabledata --action count_rows Size::Mattress
71  
72 See the L<tabledata> CLI's documentation for other available actions and options.
73  
74 =head1 DESCRIPTION
75  
76 Keywords: bed sizes
77  
78 =for Pod::Coverage ^(get_table_def)$
79  
80 =head1 HOMEPAGE
81  
82 Please visit the project's homepage at L<https://metacpan.org/release/TableData-Size-Mattress>.
83  
84 =head1 SOURCE
85  
86 Source repository is at L<https://github.com/perlancar/perl-TableData-Size-Mattress>.
87  
88 =head1 SEE ALSO
89  
90 L<https://en.wikipedia.org/wiki/Bed_size>
91  
92 =head1 AUTHOR
93  
94 perlancar <perlancar@cpan.org>
95  
96 =head1 CONTRIBUTING
97  
98  
99 To contribute, you can send patches by email/via RT, or send pull requests on
100 GitHub.
101  
102 Most of the time, you don't need to build the distribution yourself. You can
103 simply modify the code, then test via:
104  
105 % prove -l
106  
107 If you want to build the distribution (e.g. to try to install it locally on your
108 system), you can install L<Dist::Zilla>,
109 L<Dist::Zilla::PluginBundle::Author::PERLANCAR>,
110 L<Pod::Weaver::PluginBundle::Author::PERLANCAR>, and sometimes one or two other
111 Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond
112 that are considered a bug and can be reported to me.
113  
114 =head1 COPYRIGHT AND LICENSE
115  
116 This software is copyright (c) 2023 by perlancar <perlancar@cpan.org>.
117  
118 This is free software; you can redistribute it and/or modify it under
119 the same terms as the Perl 5 programming language system itself.
120  
121 =head1 BUGS
122  
123 Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=TableData-Size-Mattress>
124  
125 When submitting a bug or request, please include a test-file or a
126 patch to an existing test-file that illustrates the bug or desired
127 feature.
128  
129 =cut
130  
131 __DATA__
↑ Summary