Changeset 9566 for lang/perl/Data-Cloud

Show
Ignore:
Timestamp:
04/16/08 17:46:21 (5 years ago)
Author:
nyarla
Message:

lang/perl/Data-Cloud: I implemented clear method.

Location:
lang/perl/Data-Cloud/trunk
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Data-Cloud/trunk/lib/Data/Cloud.pm

    r9564 r9566  
    7878} 
    7979 
     80sub clear { 
     81    my ( $self ) = @_; 
     82    my $removed = $self->data; 
     83    $self->{'data'} = {}; 
     84    return $removed; 
     85} 
     86 
    80871; 
    8188__END__ 
     
    150157This method removes the number of word. 
    151158 
     159Return value is the number of the removed word. 
     160 
    152161=head2 clear 
    153162 
    154163  $cloud->clear; 
     164  my $removed = $cloud->clear; 
     165 
     166This method removes all data. 
     167 
     168A return value is hash reference including a word and the number. 
     169The form of this return value is same as C<$cloud-E<gt>data>. 
     170 
     171Please see L<"data"> for more information. 
    155172 
    156173=head2 increment