Commit | Line | Data |
6cf5bcf2 |
1 | package Moose::Autobox::String; |
2 | use Moose::Role; |
3 | |
dae37220 |
4 | our $VERSION = '0.02'; |
6cf5bcf2 |
5 | |
31d40d73 |
6 | with 'Moose::Autobox::Value'; |
7 | |
6cf5bcf2 |
8 | # perl built-ins |
9 | |
10 | sub lc { CORE::lc $_[0] } |
11 | sub lcfirst { CORE::lcfirst $_[0] } |
12 | sub uc { CORE::uc $_[0] } |
13 | sub ucfirst { CORE::ucfirst $_[0] } |
14 | sub chomp { CORE::chomp $_[0] } |
15 | sub chop { CORE::chop $_[0] } |
16 | sub reverse { CORE::reverse $_[0] } |
17 | sub length { CORE::length $_[0] } |
680d0745 |
18 | sub index { |
19 | return CORE::index($_[0], $_[1]) if scalar @_ == 2; |
20 | return CORE::index($_[0], $_[1], $_[2]); |
21 | } |
dae37220 |
22 | sub rindex { |
23 | return CORE::rindex($_[0], $_[1]) if scalar @_ == 2; |
24 | return CORE::rindex($_[0], $_[1], $_[2]); |
25 | } |
6cf5bcf2 |
26 | |
31d40d73 |
27 | 1; |
28 | |
29 | __END__ |
30 | |
31 | =pod |
32 | |
33 | =head1 NAME |
34 | |
35 | Moose::Autobox::String - the String role |
36 | |
37 | =head1 SYNOPOSIS |
38 | |
39 | use Moose::Autobox; |
31d40d73 |
40 | |
41 | "Hello World"->uc; # HELLO WORLD |
42 | |
43 | =head1 DESCRIPTION |
44 | |
8937074a |
45 | This is a role to describes a String value. |
46 | |
260cc81f |
47 | =head1 METHODS |
48 | |
49 | =over 4 |
50 | |
260cc81f |
51 | =item B<chomp> |
52 | |
53 | =item B<chop> |
54 | |
55 | =item B<index> |
56 | |
57 | =item B<lc> |
58 | |
59 | =item B<lcfirst> |
60 | |
61 | =item B<length> |
62 | |
63 | =item B<reverse> |
64 | |
dae37220 |
65 | =item B<rindex> |
66 | |
260cc81f |
67 | =item B<uc> |
68 | |
69 | =item B<ucfirst> |
70 | |
71 | =back |
72 | |
5272f13f |
73 | =over 4 |
74 | |
75 | =item B<meta> |
76 | |
77 | =back |
78 | |
31d40d73 |
79 | =head1 BUGS |
80 | |
81 | All complex software has bugs lurking in it, and this module is no |
82 | exception. If you find a bug please either email me, or add the bug |
83 | to cpan-RT. |
84 | |
85 | =head1 AUTHOR |
86 | |
87 | Stevan Little E<lt>stevan@iinteractive.comE<gt> |
88 | |
dae37220 |
89 | Anders Nor Berle E<lt>debolaz@gmail.comE<gt> |
90 | |
31d40d73 |
91 | =head1 COPYRIGHT AND LICENSE |
92 | |
93 | Copyright 2006 by Infinity Interactive, Inc. |
94 | |
95 | L<http://www.iinteractive.com> |
96 | |
97 | This library is free software; you can redistribute it and/or modify |
98 | it under the same terms as Perl itself. |
99 | |
dae37220 |
100 | =cut |
101 | |