NAME
MouseX::AttributeHelpers::String
SYNOPSIS
package MyHomePage;
use Mouse;
use MouseX::AttributeHelpers;
has 'text' => (
metaclass => 'String',
is => 'rw',
isa => 'Str',
default => '',
provides => {
append => 'add_text',
clear => 'clear_text',
},
);
package main;
my $page = MyHomePage->new;
$page->add_text("foo"); # same as $page->text($page->text . "foo");
$page->clear_text; # same as $page->text('');
DESCRIPTION
This module provides a simple string attribute, to which mutating string operations can be applied more easily.
PROVIDERS
append
prepend
replace
match
chop
chomp
inc
clear
METHODS
method_constructors
helper_type
helper_default
AUTHOR
NAKAGAWA Masaki <masaki@cpan.org>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.