NAME

MooseX::ClosedHash - blessed coderefs (closing over a hash) with Moose

SYNOPSIS

use v5.14;

package Person {
   use MooseX::ClosedHash;
   has name => (is => "rw");
   has age  => (is => "rw");
   __PACKAGE__->meta->make_immutable;
}

my $bob = Person->new(name => "Bob", age => 42);

say $bob->name, " is ", $bob->age, " years old.";
say $bob->dump;

DESCRIPTION

MooseX::ClosedHash is a Moose module that lets you store your object's attributes in a hash, closed over by a blessed coderef.

Why? I have no idea why you'd want to do this.

It provides a modicum of privacy I suppose. Privacy that is easily violated, but that you're unlikely to accidentally violate.

BUGS

Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=MooseX-ClosedHash.

SEE ALSO

http://www.perlmonks.org/?node_id=1039960.

MooseX::ArrayRef, MooseX::GlobRef, MooseX::InsideOut, etc.

AUTHOR

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE

This software is copyright (c) 2013 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

DISCLAIMER OF WARRANTIES

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.