diff options
Diffstat (limited to 'lib/Data/MultiValued')
-rw-r--r-- | lib/Data/MultiValued/AttributeAccessors.pm | 52 | ||||
-rw-r--r-- | lib/Data/MultiValued/AttributeTrait.pm | 8 | ||||
-rw-r--r-- | lib/Data/MultiValued/AttributeTrait/Ranges.pm | 8 | ||||
-rw-r--r-- | lib/Data/MultiValued/AttributeTrait/Tags.pm | 8 | ||||
-rw-r--r-- | lib/Data/MultiValued/AttributeTrait/TagsAndRanges.pm | 8 | ||||
-rw-r--r-- | lib/Data/MultiValued/Exceptions.pm | 70 | ||||
-rw-r--r-- | lib/Data/MultiValued/RangeContainer.pm | 6 | ||||
-rw-r--r-- | lib/Data/MultiValued/Ranges.pm | 6 | ||||
-rw-r--r-- | lib/Data/MultiValued/TagContainer.pm | 6 | ||||
-rw-r--r-- | lib/Data/MultiValued/TagContainerForRanges.pm | 6 | ||||
-rw-r--r-- | lib/Data/MultiValued/Tags.pm | 6 | ||||
-rw-r--r-- | lib/Data/MultiValued/TagsAndRanges.pm | 6 | ||||
-rw-r--r-- | lib/Data/MultiValued/UglySerializationHelperRole.pm | 6 |
13 files changed, 145 insertions, 51 deletions
diff --git a/lib/Data/MultiValued/AttributeAccessors.pm b/lib/Data/MultiValued/AttributeAccessors.pm index bc6fb49..e5b4cd1 100644 --- a/lib/Data/MultiValued/AttributeAccessors.pm +++ b/lib/Data/MultiValued/AttributeAccessors.pm @@ -1,6 +1,6 @@ package Data::MultiValued::AttributeAccessors; { - $Data::MultiValued::AttributeAccessors::VERSION = '0.0.1_1'; + $Data::MultiValued::AttributeAccessors::VERSION = '0.0.1_2'; } { $Data::MultiValued::AttributeAccessors::DIST = 'Data-MultiValued'; @@ -10,8 +10,12 @@ use warnings; use base 'Moose::Meta::Method::Accessor'; use Carp 'confess'; +# ABSTRACT: method meta-class for multi-valued attribute accessors + + sub _instance_is_inlinable { 0 } + sub _generate_accessor_method { my $self = shift; my $attr = $self->associated_attribute; @@ -62,6 +66,7 @@ sub _generate_clearer_method { }; } + sub _generate_multi_accessor_method { my $self = shift; my $attr = $self->associated_attribute; @@ -119,11 +124,50 @@ __END__ =head1 NAME -Data::MultiValued::AttributeAccessors +Data::MultiValued::AttributeAccessors - method meta-class for multi-valued attribute accessors =head1 VERSION -version 0.0.1_1 +version 0.0.1_2 + +=head1 DESCRIPTION + +Subclass of L<Moose::Meta::Method::Accessor>, generates non-inlined +(patches welcome) accessors for multi-valued attributes. + +=head1 METHDOS + +=head2 C<_instance_is_inlinable> + +Returns C<0> to prevent attempts to inline the accessor methods. + +=head2 C<_generate_accessor_method> + +=head2 C<_generate_reader_method> + +=head2 C<_generate_writer_method> + +=head2 C<_generate_predicate_method> + +=head2 C<_generate_clearer_method> + +Delegate to C<set_multi_value>, C<get_multi_value>, +C<has_multi_value>, C<clear_multi_value>, passing empty options +(i.e. no tags, no ranges). + +=head2 C<_generate_multi_accessor_method> + +=head2 C<_generate_multi_reader_method> + +=head2 C<_generate_multi_writer_method> + +=head2 C<_generate_multi_predicate_method> + +=head2 C<_generate_multi_clearer_method> + +Delegate to C<set_multi_value>, C<get_multi_value>, +C<has_multi_value>, C<clear_multi_value>, passing C<$_[1]> as options +and C<$_[2]> as values. =head1 AUTHOR @@ -131,7 +175,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2011 by Net-a-porter.com. +This software is copyright (c) 2011 by Net-a-Porter.com. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff --git a/lib/Data/MultiValued/AttributeTrait.pm b/lib/Data/MultiValued/AttributeTrait.pm index 6fb2b94..988144b 100644 --- a/lib/Data/MultiValued/AttributeTrait.pm +++ b/lib/Data/MultiValued/AttributeTrait.pm @@ -1,6 +1,6 @@ package Data::MultiValued::AttributeTrait; { - $Data::MultiValued::AttributeTrait::VERSION = '0.0.1_1'; + $Data::MultiValued::AttributeTrait::VERSION = '0.0.1_2'; } { $Data::MultiValued::AttributeTrait::DIST = 'Data-MultiValued'; @@ -285,7 +285,7 @@ Data::MultiValued::AttributeTrait - "base role" for traits of multi-valued Moose =head1 VERSION -version 0.0.1_1 +version 0.0.1_2 =head1 DESCRIPTION @@ -338,7 +338,7 @@ C<$name> is the attribute name. The names to use for the various additional accessors. See L<Class::MOP::Attribute> for details. These default to -C<"multi_$name"> where C<$name> is the name of the corresponding +C<"${name}_multi"> where C<$name> is the name of the corresponding non-multi accessor. So, for example, has stuff => ( @@ -492,7 +492,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2011 by Net-a-porter.com. +This software is copyright (c) 2011 by Net-a-Porter.com. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff --git a/lib/Data/MultiValued/AttributeTrait/Ranges.pm b/lib/Data/MultiValued/AttributeTrait/Ranges.pm index 01dd3da..db01513 100644 --- a/lib/Data/MultiValued/AttributeTrait/Ranges.pm +++ b/lib/Data/MultiValued/AttributeTrait/Ranges.pm @@ -1,6 +1,6 @@ package Data::MultiValued::AttributeTrait::Ranges; { - $Data::MultiValued::AttributeTrait::Ranges::VERSION = '0.0.1_1'; + $Data::MultiValued::AttributeTrait::Ranges::VERSION = '0.0.1_2'; } { $Data::MultiValued::AttributeTrait::Ranges::DIST = 'Data-MultiValued'; @@ -18,7 +18,7 @@ sub opts_to_pass_get { qw(at) } package Moose::Meta::Attribute::Custom::Trait::MultiValued::Ranges; { - $Moose::Meta::Attribute::Custom::Trait::MultiValued::Ranges::VERSION = '0.0.1_1'; + $Moose::Meta::Attribute::Custom::Trait::MultiValued::Ranges::VERSION = '0.0.1_2'; } { $Moose::Meta::Attribute::Custom::Trait::MultiValued::Ranges::DIST = 'Data-MultiValued'; @@ -37,7 +37,7 @@ Data::MultiValued::AttributeTrait::Ranges - attribute traits for attributes hold =head1 VERSION -version 0.0.1_1 +version 0.0.1_2 =head1 SYNOPSIS @@ -78,7 +78,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2011 by Net-a-porter.com. +This software is copyright (c) 2011 by Net-a-Porter.com. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff --git a/lib/Data/MultiValued/AttributeTrait/Tags.pm b/lib/Data/MultiValued/AttributeTrait/Tags.pm index 44718fe..7e880ea 100644 --- a/lib/Data/MultiValued/AttributeTrait/Tags.pm +++ b/lib/Data/MultiValued/AttributeTrait/Tags.pm @@ -1,6 +1,6 @@ package Data::MultiValued::AttributeTrait::Tags; { - $Data::MultiValued::AttributeTrait::Tags::VERSION = '0.0.1_1'; + $Data::MultiValued::AttributeTrait::Tags::VERSION = '0.0.1_2'; } { $Data::MultiValued::AttributeTrait::Tags::DIST = 'Data-MultiValued'; @@ -18,7 +18,7 @@ sub opts_to_pass_get { qw(tag) } package Moose::Meta::Attribute::Custom::Trait::MultiValued::Tags; { - $Moose::Meta::Attribute::Custom::Trait::MultiValued::Tags::VERSION = '0.0.1_1'; + $Moose::Meta::Attribute::Custom::Trait::MultiValued::Tags::VERSION = '0.0.1_2'; } { $Moose::Meta::Attribute::Custom::Trait::MultiValued::Tags::DIST = 'Data-MultiValued'; @@ -37,7 +37,7 @@ Data::MultiValued::AttributeTrait::Tags - attribute traits for attributes holdin =head1 VERSION -version 0.0.1_1 +version 0.0.1_2 =head1 SYNOPSIS @@ -78,7 +78,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2011 by Net-a-porter.com. +This software is copyright (c) 2011 by Net-a-Porter.com. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff --git a/lib/Data/MultiValued/AttributeTrait/TagsAndRanges.pm b/lib/Data/MultiValued/AttributeTrait/TagsAndRanges.pm index 98f5b8b..9ca6d74 100644 --- a/lib/Data/MultiValued/AttributeTrait/TagsAndRanges.pm +++ b/lib/Data/MultiValued/AttributeTrait/TagsAndRanges.pm @@ -1,6 +1,6 @@ package Data::MultiValued::AttributeTrait::TagsAndRanges; { - $Data::MultiValued::AttributeTrait::TagsAndRanges::VERSION = '0.0.1_1'; + $Data::MultiValued::AttributeTrait::TagsAndRanges::VERSION = '0.0.1_2'; } { $Data::MultiValued::AttributeTrait::TagsAndRanges::DIST = 'Data-MultiValued'; @@ -18,7 +18,7 @@ sub opts_to_pass_get { qw(at tag) } package Moose::Meta::Attribute::Custom::Trait::MultiValued::TagsAndRanges; { - $Moose::Meta::Attribute::Custom::Trait::MultiValued::TagsAndRanges::VERSION = '0.0.1_1'; + $Moose::Meta::Attribute::Custom::Trait::MultiValued::TagsAndRanges::VERSION = '0.0.1_2'; } { $Moose::Meta::Attribute::Custom::Trait::MultiValued::TagsAndRanges::DIST = 'Data-MultiValued'; @@ -37,7 +37,7 @@ Data::MultiValued::AttributeTrait::TagsAndRanges - attribute traits for attribut =head1 VERSION -version 0.0.1_1 +version 0.0.1_2 =head1 SYNOPSIS @@ -78,7 +78,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2011 by Net-a-porter.com. +This software is copyright (c) 2011 by Net-a-Porter.com. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff --git a/lib/Data/MultiValued/Exceptions.pm b/lib/Data/MultiValued/Exceptions.pm index b86199e..4d6a1b6 100644 --- a/lib/Data/MultiValued/Exceptions.pm +++ b/lib/Data/MultiValued/Exceptions.pm @@ -1,13 +1,17 @@ package Data::MultiValued::Exceptions; { - $Data::MultiValued::Exceptions::VERSION = '0.0.1_1'; + $Data::MultiValued::Exceptions::VERSION = '0.0.1_2'; } { $Data::MultiValued::Exceptions::DIST = 'Data-MultiValued'; } + +# ABSTRACT: exception classes + + package Data::MultiValued::Exceptions::NotFound; { - $Data::MultiValued::Exceptions::NotFound::VERSION = '0.0.1_1'; + $Data::MultiValued::Exceptions::NotFound::VERSION = '0.0.1_2'; } { $Data::MultiValued::Exceptions::NotFound::DIST = 'Data-MultiValued'; @@ -28,11 +32,12 @@ sub as_string { return $str; } - } + + package Data::MultiValued::Exceptions::TagNotFound; { - $Data::MultiValued::Exceptions::TagNotFound::VERSION = '0.0.1_1'; + $Data::MultiValued::Exceptions::TagNotFound::VERSION = '0.0.1_2'; } { $Data::MultiValued::Exceptions::TagNotFound::DIST = 'Data-MultiValued'; @@ -44,9 +49,11 @@ has '+message' => ( default => 'tag not found: ', ); } + + package Data::MultiValued::Exceptions::RangeNotFound; { - $Data::MultiValued::Exceptions::RangeNotFound::VERSION = '0.0.1_1'; + $Data::MultiValued::Exceptions::RangeNotFound::VERSION = '0.0.1_2'; } { $Data::MultiValued::Exceptions::RangeNotFound::DIST = 'Data-MultiValued'; @@ -55,12 +62,14 @@ use Moose; extends 'Data::MultiValued::Exceptions::NotFound'; has '+message' => ( - default => 'no range found for value ', + default => 'no range found for value: ', ); } + + package Data::MultiValued::Exceptions::BadRange; { - $Data::MultiValued::Exceptions::BadRange::VERSION = '0.0.1_1'; + $Data::MultiValued::Exceptions::BadRange::VERSION = '0.0.1_2'; } { $Data::MultiValued::Exceptions::BadRange::DIST = 'Data-MultiValued'; @@ -91,11 +100,52 @@ __END__ =head1 NAME -Data::MultiValued::Exceptions +Data::MultiValued::Exceptions - exception classes =head1 VERSION -version 0.0.1_1 +version 0.0.1_2 + +=head1 DESCRIPTION + +This module defines a few exception classes, using L<Throwable::Error> +as a base class. + +=head1 CLASSES + +=head2 C<Data::MultiValued::Exceptions::NotFound> + +Base class for "not found" errors. Has a C<value> attribute, +containing the value that was not found. + +=head2 C<Data::MultiValued::Exceptions::TagNotFound> + +Subclass of L<Data::MultiValued::Exceptions::NotFound>, for +tags. Stringifies to: + + tag not found: $value + + $stack_trace + +=head2 C<Data::MultiValued::Exceptions::RangeNotFound> + +Subclass of L<Data::MultiValued::Exceptions::NotFound>, for +ranges. Stringifies to: + + no range found for value: $value + + $stack_trace + +=head2 C<Data::MultiValued::Exceptions::BadRange> + +Thrown when an invalid range is supplied to a method. An invalid range +is a range with C<from> greater than C<to>. + +Stringifies to: + + invalid range: $from, $to + + $stack_trace =head1 AUTHOR @@ -103,7 +153,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2011 by Net-a-porter.com. +This software is copyright (c) 2011 by Net-a-Porter.com. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff --git a/lib/Data/MultiValued/RangeContainer.pm b/lib/Data/MultiValued/RangeContainer.pm index 9824d6a..0b8835b 100644 --- a/lib/Data/MultiValued/RangeContainer.pm +++ b/lib/Data/MultiValued/RangeContainer.pm @@ -1,6 +1,6 @@ package Data::MultiValued::RangeContainer; { - $Data::MultiValued::RangeContainer::VERSION = '0.0.1_1'; + $Data::MultiValued::RangeContainer::VERSION = '0.0.1_2'; } { $Data::MultiValued::RangeContainer::DIST = 'Data-MultiValued'; @@ -243,7 +243,7 @@ Data::MultiValued::RangeContainer - container for ranged values =head1 VERSION -version 0.0.1_1 +version 0.0.1_2 =head1 DESCRIPTION @@ -303,7 +303,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2011 by Net-a-porter.com. +This software is copyright (c) 2011 by Net-a-Porter.com. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff --git a/lib/Data/MultiValued/Ranges.pm b/lib/Data/MultiValued/Ranges.pm index ef955ab..f4a2a2d 100644 --- a/lib/Data/MultiValued/Ranges.pm +++ b/lib/Data/MultiValued/Ranges.pm @@ -1,6 +1,6 @@ package Data::MultiValued::Ranges; { - $Data::MultiValued::Ranges::VERSION = '0.0.1_1'; + $Data::MultiValued::Ranges::VERSION = '0.0.1_2'; } { $Data::MultiValued::Ranges::DIST = 'Data-MultiValued'; @@ -89,7 +89,7 @@ Data::MultiValued::Ranges - Handle values with validity ranges =head1 VERSION -version 0.0.1_1 +version 0.0.1_2 =head1 SYNOPSIS @@ -203,7 +203,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2011 by Net-a-porter.com. +This software is copyright (c) 2011 by Net-a-Porter.com. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff --git a/lib/Data/MultiValued/TagContainer.pm b/lib/Data/MultiValued/TagContainer.pm index e030dcc..143b6f4 100644 --- a/lib/Data/MultiValued/TagContainer.pm +++ b/lib/Data/MultiValued/TagContainer.pm @@ -1,6 +1,6 @@ package Data::MultiValued::TagContainer; { - $Data::MultiValued::TagContainer::VERSION = '0.0.1_1'; + $Data::MultiValued::TagContainer::VERSION = '0.0.1_2'; } { $Data::MultiValued::TagContainer::DIST = 'Data-MultiValued'; @@ -121,7 +121,7 @@ Data::MultiValued::TagContainer - container for tagged values =head1 VERSION -version 0.0.1_1 +version 0.0.1_2 =head1 DESCRIPTION @@ -190,7 +190,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2011 by Net-a-porter.com. +This software is copyright (c) 2011 by Net-a-Porter.com. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff --git a/lib/Data/MultiValued/TagContainerForRanges.pm b/lib/Data/MultiValued/TagContainerForRanges.pm index d2b3c25..452d1bd 100644 --- a/lib/Data/MultiValued/TagContainerForRanges.pm +++ b/lib/Data/MultiValued/TagContainerForRanges.pm @@ -1,6 +1,6 @@ package Data::MultiValued::TagContainerForRanges; { - $Data::MultiValued::TagContainerForRanges::VERSION = '0.0.1_1'; + $Data::MultiValued::TagContainerForRanges::VERSION = '0.0.1_2'; } { $Data::MultiValued::TagContainerForRanges::DIST = 'Data-MultiValued'; @@ -63,7 +63,7 @@ Data::MultiValued::TagContainerForRanges - container for tagged values that are =head1 VERSION -version 0.0.1_1 +version 0.0.1_2 =head1 DESCRIPTION @@ -100,7 +100,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2011 by Net-a-porter.com. +This software is copyright (c) 2011 by Net-a-Porter.com. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff --git a/lib/Data/MultiValued/Tags.pm b/lib/Data/MultiValued/Tags.pm index 6c7bef9..1d93310 100644 --- a/lib/Data/MultiValued/Tags.pm +++ b/lib/Data/MultiValued/Tags.pm @@ -1,6 +1,6 @@ package Data::MultiValued::Tags; { - $Data::MultiValued::Tags::VERSION = '0.0.1_1'; + $Data::MultiValued::Tags::VERSION = '0.0.1_2'; } { $Data::MultiValued::Tags::DIST = 'Data-MultiValued'; @@ -86,7 +86,7 @@ Data::MultiValued::Tags - Handle values with tags =head1 VERSION -version 0.0.1_1 +version 0.0.1_2 =head1 SYNOPSIS @@ -163,7 +163,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2011 by Net-a-porter.com. +This software is copyright (c) 2011 by Net-a-Porter.com. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff --git a/lib/Data/MultiValued/TagsAndRanges.pm b/lib/Data/MultiValued/TagsAndRanges.pm index 414660e..506d7e9 100644 --- a/lib/Data/MultiValued/TagsAndRanges.pm +++ b/lib/Data/MultiValued/TagsAndRanges.pm @@ -1,6 +1,6 @@ package Data::MultiValued::TagsAndRanges; { - $Data::MultiValued::TagsAndRanges::VERSION = '0.0.1_1'; + $Data::MultiValued::TagsAndRanges::VERSION = '0.0.1_2'; } { $Data::MultiValued::TagsAndRanges::DIST = 'Data-MultiValued'; @@ -99,7 +99,7 @@ Data::MultiValued::TagsAndRanges - Handle values with tags and validity ranges =head1 VERSION -version 0.0.1_1 +version 0.0.1_2 =head1 SYNOPSIS @@ -175,7 +175,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2011 by Net-a-porter.com. +This software is copyright (c) 2011 by Net-a-Porter.com. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff --git a/lib/Data/MultiValued/UglySerializationHelperRole.pm b/lib/Data/MultiValued/UglySerializationHelperRole.pm index 8309832..4375434 100644 --- a/lib/Data/MultiValued/UglySerializationHelperRole.pm +++ b/lib/Data/MultiValued/UglySerializationHelperRole.pm @@ -1,6 +1,6 @@ package Data::MultiValued::UglySerializationHelperRole; { - $Data::MultiValued::UglySerializationHelperRole::VERSION = '0.0.1_1'; + $Data::MultiValued::UglySerializationHelperRole::VERSION = '0.0.1_2'; } { $Data::MultiValued::UglySerializationHelperRole::DIST = 'Data-MultiValued'; @@ -54,7 +54,7 @@ Data::MultiValued::UglySerializationHelperRole - only use this if you know what =head1 VERSION -version 0.0.1_1 +version 0.0.1_2 =head1 SYNOPSIS @@ -132,7 +132,7 @@ Gianni Ceccarelli <dakkar@thenautilus.net> =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2011 by Net-a-porter.com. +This software is copyright (c) 2011 by Net-a-Porter.com. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. |