blib/lib/Gapp/Table.pm untested

filter: Statementstmt 0.0% 0 / 37 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 53 CC 4 SCAR 17.0
CC
4
Cov
0%
next_cell
12.0
current_cell
6.0
BEGIN
2.0
CRAP 5.5
1 package Gapp::Table;
2 {
3 $Gapp::Table::VERSION = '0.60';
4 }
5  
6  
7 use Moose;
8 use MooseX::LazyRequire;
9 use MooseX::SemiAffordanceAccessor;
10 use MooseX::StrictConstructor;
11 extends 'Gapp::Container';
12  
13 use Gapp::TableMap;
14 use Gapp::Types qw( GappTableMap );
15  
16 has '+gclass' => (
17 default => 'Gtk2::Table',
18 );
19  
20 has 'map' => (
21 is => 'rw',
22 isa => GappTableMap,
23 coerce => 1,
24 lazy_required => 1,
25 );
26  
27 has '_active_cell' => (
28 is => 'rw',
29 isa => 'Maybe[Int]',
30 );
31  
32 sub current_cell {
33 my ( $self ) = @_;
34 $self->_active_cell ? $self->map->cells->[ $self->_active_cell ] : undef;
35 }
36  
37 sub next_cell {
38 my ( $self ) = @_;
39
40 my $x = defined $self->_active_cell ? $self->_active_cell + 1 : 0;
41 my $cell = $self->map->cells->[$x];
42 $self->_set_active_cell( $cell ? $x : undef );
43 return $cell;
44 }
45  
46  
47 before _construct_gobject => sub {
48 my $self = shift;
49 return $self->set_args( [ $self->map->row_count, $self->map->col_count, 0 ] );
50 };
51  
52  
53  
54 1;
55  
56  
57 __END__