69bc9778554a30bb127f93f2f2a07ec6c064fd91
[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   
40   "Hello World"->uc; # HELLO WORLD
41
42 =head1 DESCRIPTION
43
44 This is a role to describes a String value.
45
46 =head1 METHODS
47
48 =over 4
49
50 =item B<chomp>
51
52 =item B<chop>
53
54 =item B<index>
55
56 =item B<lc>
57
58 =item B<lcfirst>
59
60 =item B<length>
61
62 =item B<reverse>
63
64 =item B<uc>
65
66 =item B<ucfirst>
67
68 =back
69
70 =over 4
71
72 =item B<meta>
73
74 =back
75
76 =head1 BUGS
77
78 All complex software has bugs lurking in it, and this module is no 
79 exception. If you find a bug please either email me, or add the bug
80 to cpan-RT.
81
82 =head1 AUTHOR
83
84 Stevan Little E<lt>stevan@iinteractive.comE<gt>
85
86 =head1 COPYRIGHT AND LICENSE
87
88 Copyright 2006 by Infinity Interactive, Inc.
89
90 L<http://www.iinteractive.com>
91
92 This library is free software; you can redistribute it and/or modify
93 it under the same terms as Perl itself.
94
95 =cut