in reply to Re^4: Moose: Accessing subroutines in packages used by Moose class
in thread Moose: Accessing subroutines in packages used by Moose class
The package 'Bogus' in my example is analogous to X11::GUITest in your example i.e. it contains the subs that you want to wrap.
So translating to your example it would look like:Then to use it:package X11_GUITest_Wrapper; use Moose; use MooseX::NonMoose; extends 'X11::GUITest'; around [qw( SendKeys FindWindowLike ClickWindow SetEventSendDelay )] = +> sub { my $orig = shift; my $self = shift; $orig->(@_); }; 1;
package FFMech; $ENV{'DISPLAY'} = ':0.0'; use Moose; use Modern::Perl; use MooseX::NonMoose; extends 'WWW::Mechanize::Firefox'; has 'x11_guitest_wrapper' => ( is => 'bare', default => sub { X11_GUITest_Wrapper->new }, handles => [qw( SendKeys FindWindowLike ClickWindow SetEventSendDe +lay )], ); # ... 1;
|
|---|