summaryrefslogtreecommitdiff
path: root/Data-MultiValued/lib/Data/MultiValued/TagsAndRanges.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Data-MultiValued/lib/Data/MultiValued/TagsAndRanges.pm')
-rw-r--r--Data-MultiValued/lib/Data/MultiValued/TagsAndRanges.pm15
1 files changed, 13 insertions, 2 deletions
diff --git a/Data-MultiValued/lib/Data/MultiValued/TagsAndRanges.pm b/Data-MultiValued/lib/Data/MultiValued/TagsAndRanges.pm
index 82e3271..6208435 100644
--- a/Data-MultiValued/lib/Data/MultiValued/TagsAndRanges.pm
+++ b/Data-MultiValued/lib/Data/MultiValued/TagsAndRanges.pm
@@ -60,9 +60,20 @@ sub get {
}
sub clear {
- my ($self) = @_;
+ my ($self,%args) = validated_hash(
+ \@_,
+ from => { isa => Num|Undef, optional => 1, },
+ to => { isa => Num|Undef, optional => 1, },
+ tag => { isa => Str, optional => 1, },
+ );
- $self->_clear_storage;
+ if (exists $args{from} || exists $args{to}) {
+ $self->_storage->get(\%args)
+ ->clear(\%args);
+ }
+ else {
+ $self->_storage->clear(\%args);
+ }
}
1;