File Coverage

blib/lib/Data/MultiValued/AttributeTrait/TagsAndRanges.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::TagsAndRanges;
2             {
3             $Data::MultiValued::AttributeTrait::TagsAndRanges::VERSION = '0.0.1_4';
4             }
5             {
6             $Data::MultiValued::AttributeTrait::TagsAndRanges::DIST = 'Data-MultiValued';
7             }
8 1     1   1029 use Moose::Role;
  1         2  
  1         11  
9 1     1   6168 use namespace::autoclean;
  1         2  
  1         9  
10 1     1   1084 use Data::MultiValued::TagsAndRanges;
  1         4  
  1         212  
11             with 'Data::MultiValued::AttributeTrait';
12              
13             # ABSTRACT: attribute traits for attributes holding tagged and ranged values
14              
15              
16 2     2 1 59 sub multivalue_storage_class { 'Data::MultiValued::TagsAndRanges' };
17 2     2 1 15 sub opts_to_pass_set { qw(from to tag) }
18 3     3 1 19 sub opts_to_pass_get { qw(at tag) }
19              
20             package Moose::Meta::Attribute::Custom::Trait::MultiValued::TagsAndRanges;
21             {
22             $Moose::Meta::Attribute::Custom::Trait::MultiValued::TagsAndRanges::VERSION = '0.0.1_4';
23             }
24             {
25             $Moose::Meta::Attribute::Custom::Trait::MultiValued::TagsAndRanges::DIST = 'Data-MultiValued';
26             }{
27 1     1   997 sub register_implementation { 'Data::MultiValued::AttributeTrait::TagsAndRanges' }
28             }
29              
30             1;
31              
32             __END__
33             =pod
34              
35             =encoding utf-8
36              
37             =head1 NAME
38              
39             Data::MultiValued::AttributeTrait::TagsAndRanges - attribute traits for attributes holding tagged and ranged 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::TagsAndRanges;
50              
51             has stuff => (
52             is => 'rw',
53             isa => 'Int',
54             traits => ['MultiValued::TagsAndRanges'],
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::TagsAndRanges> as multi-value
64             storage:
65              
66             =head2 C<multivalue_storage_class>
67              
68             Returns C<'Data::MultiValued::TagsAndRanges'>.
69              
70             =head2 C<opts_to_pass_set>
71              
72             Returns C<('tag', 'from', 'to')>.
73              
74             =head2 C<opts_to_pass_get>
75              
76             Returns C<('tag', 'at')>.
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