aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/ViewPort/Field/Role/Mutable/Simple.pm
diff options
context:
space:
mode:
authorgroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2009-12-14 21:03:04 +0000
committergroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2009-12-14 21:03:04 +0000
commitf1a74541734521d2b5013bcd577860d98ff727f5 (patch)
tree81446076153c98a8686df432673f0ee16bb80940 /lib/Reaction/UI/ViewPort/Field/Role/Mutable/Simple.pm
parent26fa3b8aef9774f0ebd25fcbda6297cb263417e9 (diff)
parenta722f3e3e226a7319f69722de01c06792b3cf2c3 (diff)
downloadreaction-f1a74541734521d2b5013bcd577860d98ff727f5.tar.gz
reaction-f1a74541734521d2b5013bcd577860d98ff727f5.zip
r31712@martha (orig r1247): groditi | 2009-10-02 17:02:01 -0400
whoops compile error r32396@martha (orig r1251): wreis | 2009-11-04 14:37:47 -0500 undo r1236 r32468@martha (orig r1254): edenc | 2009-11-16 16:48:46 -0500 r15979@debian (orig r1252): edenc | 2009-11-10 21:45:38 -0300 branching for clone-and-inherit workaround r15980@debian (orig r1253): edenc | 2009-11-10 21:50:34 -0300 working around Moose glitch via parameterized roles r32469@martha (orig r1255): edenc | 2009-11-16 17:06:25 -0500 added clone and inherit fix to Field::Mutable::HiddenArray r32618@martha (orig r1256): edenc | 2009-12-04 16:35:06 -0500 fixed hash deref bug in the base controller
Diffstat (limited to 'lib/Reaction/UI/ViewPort/Field/Role/Mutable/Simple.pm')
-rw-r--r--lib/Reaction/UI/ViewPort/Field/Role/Mutable/Simple.pm17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/Reaction/UI/ViewPort/Field/Role/Mutable/Simple.pm b/lib/Reaction/UI/ViewPort/Field/Role/Mutable/Simple.pm
index e19fa61..d8ca473 100644
--- a/lib/Reaction/UI/ViewPort/Field/Role/Mutable/Simple.pm
+++ b/lib/Reaction/UI/ViewPort/Field/Role/Mutable/Simple.pm
@@ -1,14 +1,23 @@
package Reaction::UI::ViewPort::Field::Role::Mutable::Simple;
-use Reaction::Role;
+use MooseX::Role::Parameterized;
use aliased 'Reaction::UI::ViewPort::Field::Role::Mutable';
use namespace::clean -except => [ qw(meta) ];
-with Mutable;
+
+parameter value_type => (
+ predicate => 'has_value_type'
+);
+
+role {
+
+my $p = shift;
+
+with Mutable, $p->has_value_type ? { value_type => $p->value_type } : ();
has value_string => (
- is => 'rw', lazy_build => 1, trigger_adopt('value_string'),
+ is => 'rw', lazy_build => 1, trigger => sub { shift->adopt_value_string },
clearer => 'clear_value',
);
@@ -44,6 +53,6 @@ around accept_events => sub { ('value_string', shift->(@_)) };
around force_events => sub { (value_string => '', shift->(@_)) };
-
+};
1;