File Coverage

blib/lib/Moose/Autobox/Scalar.pm
Criterion Covered Total %
statement 9 11 81.8
branch n/a
condition n/a
subroutine 5 7 71.4
pod 5 5 100.0
total 19 23 82.6


line stmt bran cond sub pod time code
1             package Moose::Autobox::Scalar;
2             # ABSTRACT: the Scalar role
3 14     14   63 use Moose::Role 'with';
  14         19  
  14         80  
4 14     14   44786 use namespace::autoclean;
  14         24  
  14         100  
5              
6             our $VERSION = '0.16';
7              
8             with 'Moose::Autobox::String',
9             'Moose::Autobox::Number';
10              
11 3     3 1 726 sub flatten { $_[0] }
12 1     1 1 877 sub first { $_[0] }
13 1     1 1 4 sub last { $_[0] }
14 0     0 1   sub print { CORE::print $_[0] }
15 0     0 1   sub say { CORE::print $_[0], "\n" }
16              
17             1;
18              
19             __END__
20              
21             =pod
22              
23             =encoding UTF-8
24              
25             =head1 NAME
26              
27             Moose::Autobox::Scalar - the Scalar role
28              
29             =head1 VERSION
30              
31             version 0.16
32              
33             =head1 DESCRIPTION
34              
35             This is a role to describes a Scalar value, which is defined
36             as the combination (union sort of) of a String and a Number.
37              
38             =head1 METHODS
39              
40             =over 4
41              
42             =item C<meta>
43              
44             =item C<print>
45              
46             =item C<say>
47              
48             =item C<flatten>
49              
50             Flattening a scalar just returns the scalar. This means that you can say:
51              
52             my @array = $input->flatten;
53              
54             # Given $input of 5, @array is (5);
55             # Given $input of [ 5, 2, 0], @array is (5, 2, 0)
56              
57             =item C<first>
58              
59             As per flatten.
60              
61             =item C<last>
62              
63             As per flatten.
64              
65             =back
66              
67             =head1 SUPPORT
68              
69             Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Moose-Autobox>
70             (or L<bug-Moose-Autobox@rt.cpan.org|mailto:bug-Moose-Autobox@rt.cpan.org>).
71              
72             There is also a mailing list available for users of this distribution, at
73             L<http://lists.perl.org/list/moose.html>.
74              
75             There is also an irc channel available for users of this distribution, at
76             L<C<#moose> on C<irc.perl.org>|irc://irc.perl.org/#moose>.
77              
78             =head1 AUTHOR
79              
80             Stevan Little <stevan.little@iinteractive.com>
81              
82             =head1 COPYRIGHT AND LICENSE
83              
84             This software is copyright (c) 2006 by Infinity Interactive, Inc.
85              
86             This is free software; you can redistribute it and/or modify it under
87             the same terms as the Perl 5 programming language system itself.
88              
89             =cut