diff options
Diffstat (limited to 'lib/Data')
-rw-r--r-- | lib/Data/MultiValued/RangeContainer.pm | 15 | ||||
-rw-r--r-- | lib/Data/MultiValued/TagContainer.pm | 8 |
2 files changed, 23 insertions, 0 deletions
diff --git a/lib/Data/MultiValued/RangeContainer.pm b/lib/Data/MultiValued/RangeContainer.pm index 0bfe8cd..83dae11 100644 --- a/lib/Data/MultiValued/RangeContainer.pm +++ b/lib/Data/MultiValued/RangeContainer.pm @@ -268,4 +268,19 @@ sub _splice_slot { return $new; } +=head2 C<all_ranges> + + my @ranges = $obj->all_ranges; + +Returns all the ranges defined in this object, as a list of 2-elements +arrayrefs. + +=cut + +sub all_ranges { + my ($self) = @_; + + return map { [ $_->{from}, $_->{to} ] } @{$self->_storage}; +} + 1; diff --git a/lib/Data/MultiValued/TagContainer.pm b/lib/Data/MultiValued/TagContainer.pm index b7a9b13..bdeca24 100644 --- a/lib/Data/MultiValued/TagContainer.pm +++ b/lib/Data/MultiValued/TagContainer.pm @@ -35,6 +35,7 @@ has _storage => ( _get_tag => 'get', _create_tag => 'set', _delete_tag => 'delete', + all_tags => 'keys', }, ); @@ -150,6 +151,13 @@ sub clear { return; } +=head2 C<all_tags> + + my @tags = $obj->all_tags; + +Returns all the tags defined in this object. Does not return the +C<undef> tag. + =head2 C<_create_new_inferior> Returns a new "storage cell", by default an empty hashref. See |