Bio-Community

 view release on metacpan or  search on metacpan

lib/Bio/Community/Role/Locked.pm  view on Meta::CPAN

#
# Please direct questions and support issues to <bioperl-l@bioperl.org>
#
# Copyright 2011-2014 Florent Angly <florent.angly@gmail.com>
#
# You may distribute this module under the same terms as perl itself


=head1 NAME

Bio::Community::Role::Locked - Role for objects that can be locked (made read-only)

=head1 SYNOPSIS

  package My::Package;

  use Moose;
  with 'Bio::Community::Role::Locked';

  # Use the lock() and unlock() methods as needed
  # ...

  1;

=head1 DESCRIPTION

This role provides the capability to make objects of the class that consumes this
role read-only. The lock() method can be invoked to make an object read-only,
while unlock() restores the read/write properties of the object. If you try to
call a method to modify an object that is locked or otherwise attempt to change
its hash, you will get an error similar to this:

 Modification of a read-only value attempted at accessor Bio::Community::Member::foo

=head1 AUTHOR

Florent Angly L<florent.angly@gmail.com>

=head1 SUPPORT AND BUGS



( run in 0.624 second using v1.01-cache-2.11-cpan-49f99fa48dc )