diff options
author | edenc <edenc@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-11-16 21:48:46 +0000 |
---|---|---|
committer | edenc <edenc@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-11-16 21:48:46 +0000 |
commit | 998595871bf67dd45ae1aff91ef764ad9544df50 (patch) | |
tree | 283bd004057bbb4c5b4d55ee78e6b4d329ebd976 /lib/Reaction/UI/ViewPort/Field/Role/Mutable/Simple.pm | |
parent | fce142bbcc216ecb8a9e906000be683e9b4ccff9 (diff) | |
parent | 22a2b24377352d8e5b1be2942d559cc3fef4df2e (diff) | |
download | reaction-998595871bf67dd45ae1aff91ef764ad9544df50.tar.gz reaction-998595871bf67dd45ae1aff91ef764ad9544df50.zip |
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
Diffstat (limited to 'lib/Reaction/UI/ViewPort/Field/Role/Mutable/Simple.pm')
-rw-r--r-- | lib/Reaction/UI/ViewPort/Field/Role/Mutable/Simple.pm | 17 |
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; |