File Coverage

blib/lib/OpenERP/OOM/Roles/Class.pm
Criterion Covered Total %
statement 8 8 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             =head1 NAME
2              
3             OpenERP::OOM::Roles::Class - Class attribute for setting up dirty attribute tracking.
4              
5             =head1 DESCRIPTION
6              
7             This code was largely taken from a version of MooseX::TrackDirty before it
8             was updated to work with Moose 2.0. Then it was cut down to suit our purposes
9             being uses in the Moose::Exporter.
10              
11              
12             =head1 LICENSE AND COPYRIGHT
13              
14             Copyright (C) 2011 OpusVL
15              
16             This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
17              
18             =cut
19              
20             use namespace::autoclean;
21 2     2   9163 use Moose::Role;
  2         3  
  2         27  
22 2     2   135  
  2         3  
  2         12  
23             has __track_dirty => (
24             traits => [ 'Hash' ],
25             is => 'rw',
26             isa => 'HashRef',
27             builder => '__build_track_dirty',
28              
29             handles => {
30             is_dirty => 'exists',
31             mark_clean => 'delete',
32             mark_all_clean => 'clear',
33             has_dirty_attributes => 'count',
34             all_attributes_clean => 'is_empty',
35             dirty_attributes => 'keys',
36             _set_dirty => 'set',
37             },
38             );
39              
40              
41 1     1   774 1;
42 1     1   37