File Coverage

blib/lib/Data/MultiValued/AttributeTrait/Tags.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 3 3 100.0
total 23 23 100.0


line stmt bran cond sub pod time code
1             package Data::MultiValued::AttributeTrait::Tags;
2             {
3             $Data::MultiValued::AttributeTrait::Tags::VERSION = '0.0.1_4';
4             }
5             {
6             $Data::MultiValued::AttributeTrait::Tags::DIST = 'Data-MultiValued';
7             }
8 2     2   1688356 use Moose::Role;
  2         18825  
  2         71  
9 2     2   18198 use namespace::autoclean;
  2         3668  
  2         12  
10 2     2   1434 use Data::MultiValued::Tags;
  2         8  
  2         456  
11             with 'Data::MultiValued::AttributeTrait';
12              
13             # ABSTRACT: attribute traits for attributes holding tagged values
14              
15              
16 8     8 1 341 sub multivalue_storage_class { 'Data::MultiValued::Tags' };
17 8     8 1 39 sub opts_to_pass_set { qw(tag) }
18 21     21 1 74 sub opts_to_pass_get { qw(tag) }
19              
20             package Moose::Meta::Attribute::Custom::Trait::MultiValued::Tags;
21             {
22             $Moose::Meta::Attribute::Custom::Trait::MultiValued::Tags::VERSION = '0.0.1_4';
23             }
24             {
25             $Moose::Meta::Attribute::Custom::Trait::MultiValued::Tags::DIST = 'Data-MultiValued';
26             }{
27 2     2   3857 sub register_implementation { 'Data::MultiValued::AttributeTrait::Tags' }
28             }
29              
30             1;
31              
32             __END__
33             =pod
34              
35             =encoding utf-8
36              
37             =head1 NAME
38              
39             Data::MultiValued::AttributeTrait::Tags - attribute traits for attributes holding tagged values
40              
41             =head1 VERSION
42              
43             version 0.0.1_4
44              
45             =head1 SYNOPSIS
46              
47             package My::Class;
48             use Moose;
49             use Data::MultiValued::AttributeTrait::Tags;
50              
51             has stuff => (
52             is => 'rw',
53             isa => 'Int',
54             traits => ['MultiValued::Tags'],
55             predicate => 'has_stuff',
56             multi_accessor => 'stuff_tagged',
57             multi_predicate => 'has_stuff_tagged',
58             );
59              
60             =head1 DESCRIPTION
61              
62             This role consumes L<Data::MultiValued::AttributeTrait> and
63             specialises it to use L<Data::MultiValued::Tags> as multi-value
64             storage:
65              
66             =head2 C<multivalue_storage_class>
67              
68             Returns C<'Data::MultiValued::Tags'>.
69              
70             =head2 C<opts_to_pass_set>
71              
72             Returns C<('tag')>.
73              
74             =head2 C<opts_to_pass_get>
75              
76             Returns C<('tag')>.
77              
78             =head1 AUTHOR
79              
80             Gianni Ceccarelli <dakkar@thenautilus.net>
81              
82             =head1 COPYRIGHT AND LICENSE
83              
84             This software is copyright (c) 2011 by Net-a-Porter.com.
85              
86             This is free software; you can redistribute it and/or modify it under
87             the same terms as the Perl 5 programming language system itself.
88              
89             =cut
90