718410e1f2f23d622619d7a4df579a63e73338c9
[gitmo/Moose-Autobox.git] / lib / Moose / Autobox / String.pm
1 package Moose::Autobox::String;
2 use Moose::Role;
3
4 our $VERSION = '0.01';
5
6 with 'Moose::Autobox::Value';
7
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] }
18 sub index   { 
19     return CORE::index($_[0], $_[1]) if scalar @_ == 2;
20     return CORE::index($_[0], $_[1], $_[2]);
21 }
22
23 # FIXME: this is not working 
24 #sub rindex  { CORE::rindex  $_[0], $_[1], (defined $_[2] ? $_[2] : ()) }
25      
26 1;
27
28 __END__
29
30 =pod
31
32 =head1 NAME 
33
34 Moose::Autobox::String - the String role
35
36 =head1 SYNOPOSIS
37
38   use Moose::Autobox;
39   use autobox;
40   
41   "Hello World"->uc; # HELLO WORLD
42
43 =head1 DESCRIPTION
44
45 This is a role to describes a String value.
46
47 =head1 METHODS
48
49 =over 4
50
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
65 =item B<uc>
66
67 =item B<ucfirst>
68
69 =back
70
71 =over 4
72
73 =item B<meta>
74
75 =back
76
77 =head1 BUGS
78
79 All complex software has bugs lurking in it, and this module is no 
80 exception. If you find a bug please either email me, or add the bug
81 to cpan-RT.
82
83 =head1 AUTHOR
84
85 Stevan Little E<lt>stevan@iinteractive.comE<gt>
86
87 =head1 COPYRIGHT AND LICENSE
88
89 Copyright 2006 by Infinity Interactive, Inc.
90
91 L<http://www.iinteractive.com>
92
93 This library is free software; you can redistribute it and/or modify
94 it under the same terms as Perl itself.
95
96 =cut