From: Matt S Trout Date: Sat, 8 Jan 2011 05:50:55 +0000 (+0000) Subject: switch to using Moo's constructor rather than hacking configure to avoid upsetting... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d3a0b2ab05a2ada40f15fb9275a91b258ed697a7;p=scpubgit%2FClifton.git switch to using Moo's constructor rather than hacking configure to avoid upsetting IO::Async::Notifier --- diff --git a/lib/App/Clifton/Component.pm b/lib/App/Clifton/Component.pm index 2a51217..e6d592c 100644 --- a/lib/App/Clifton/Component.pm +++ b/lib/App/Clifton/Component.pm @@ -9,7 +9,10 @@ sub _debug_self { use Log::Contextual qw(:log); use Moo; -extends 'IO::Async::Notifier'; +extends 'Moo::Object', 'IO::Async::Notifier'; + +# we're replacing Notifier's constructor so need to set up its default +has children => (is => 'bare', default => sub { [] }); sub BUILD { my ($self, $args) = @_; @@ -21,12 +24,6 @@ sub BUILD { } } -sub configure { - # If we called the superclass method, any ->new params that were populated - # into attributes would cause a croak. While the loss of error checking is - # annoying I've got other things to fix right now. -} - sub _new_child { my ($self, $class, $args) = @_; $class->new(%{$args||{}}, parent_component => $self);