blib/lib/Gapp/UIManager.pm untested

filter: Statementstmt 0.0% 0 / 32 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 37 CC 1 SCAR 6.9
CC
1
Cov
0%
_apply_actions_to_gobject
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Gapp::UIManager;
2 {
3 $Gapp::UIManager::VERSION = '0.60';
4 }
5  
6 use Moose;
7 use MooseX::SemiAffordanceAccessor;
8 extends 'Gapp::Object';
9  
10 use Gapp::ActionGroup;
11  
12 has '+gclass' => (
13 default => 'Gtk2::UIManager',
14 );
15  
16 has 'files' => (
17 is => 'rw',
18 isa => 'ArrayRef',
19 default => sub { [ ] },
20 );
21  
22 has 'actions' => (
23 is => 'rw',
24 isa => 'ArrayRef',
25 default => sub { [ ] },
26 );
27  
28 has 'action_args' => (
29 is => 'rw',
30 isa => 'ArrayRef',
31 default => sub { [ ] },
32 );
33  
34 after _construct_gobject => sub {
35 my $self = shift;
36 $self->gobject->add_ui_from_file( $_ ) for @{ $self->files };
37 $self->_apply_actions_to_gobject;
38 };
39  
40 sub _apply_actions_to_gobject {
41 my ( $self ) = @_;
42
43 my $group = Gapp::ActionGroup->new( actions => [@{$self->actions}], action_args => [@{$self->action_args}] );
44 $self->gobject->insert_action_group( $group->gobject, 0 );
45 }
46  
47 1;
48  
49 __END__