File Coverage

blib/lib/Buffer/Transactional/Buffer/Array.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             package Buffer::Transactional::Buffer::Array;
2 1     1   2624 use Moose;
  0            
  0            
3              
4             our $VERSION = '0.02';
5             our $AUTHORITY = 'cpan:STEVAN';
6              
7             has '_buffer' => (
8             traits => [ 'Array' ],
9             is => 'ro',
10             isa => 'ArrayRef',
11             lazy => 1,
12             default => sub { [] },
13             handles => {
14             'put' => 'push',
15             'as_string' => [ 'join', '' ],
16             '_flatten' => 'elements',
17             }
18             );
19              
20             # *sigh* Moose
21             with 'Buffer::Transactional::Buffer';
22              
23             sub subsume {
24             my ($self, $buffer) = @_;
25             $self->put( $buffer->_flatten );
26             }
27              
28             __PACKAGE__->meta->make_immutable;
29              
30             no Moose; 1;
31              
32             __END__
33              
34             =pod
35              
36             =head1 NAME
37              
38             Buffer::Transactional::Buffer::Array - An arrayref based buffer
39              
40             =head1 BUGS
41              
42             All complex software has bugs lurking in it, and this module is no
43             exception. If you find a bug please either email me, or add the bug
44             to cpan-RT.
45              
46             =head1 AUTHOR
47              
48             Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
49              
50             =head1 COPYRIGHT AND LICENSE
51              
52             Copyright 2009, 2010 Infinity Interactive, Inc.
53              
54             L<http://www.iinteractive.com>
55              
56             This library is free software; you can redistribute it and/or modify
57             it under the same terms as Perl itself.
58              
59             =cut