MooseX::InsideOut - inside-out objects with Moose


MooseX-InsideOut documentation Contained in the MooseX-InsideOut distribution.

Index


Code Index:

NAME

Top

MooseX::InsideOut - inside-out objects with Moose

VERSION

Top

version 0.106

SYNOPSIS

Top

  package My::Object;

  use MooseX::InsideOut;

  # ... normal Moose functionality
  # or ...

  package My::Subclass;

  use MooseX::InsideOut;
  extends 'Some::Other::Class';

DESCRIPTION

Top

MooseX::InsideOut provides metaroles for inside-out objects. That is, it sets up attribute slot storage somewhere other than inside $self. This means that you can extend non-Moose classes, whose internals you either don't want to care about or aren't hash-based.

METHODS

Top

init_meta

Apply the instance metarole necessary for inside-out storage.

TODO

Top

* dumping (for debugging purposes)
* serialization (for e.g. storable)
* (your suggestions here)

AUTHOR

Top

Hans Dieter Pearcey <hdp@cpan.org>

COPYRIGHT AND LICENSE

Top


MooseX-InsideOut documentation Contained in the MooseX-InsideOut distribution.

use strict;
use warnings;

package MooseX::InsideOut;
BEGIN {
  $MooseX::InsideOut::VERSION = '0.106';
}
# ABSTRACT: inside-out objects with Moose

use Moose ();
use Moose::Exporter;
use Moose::Util::MetaRole;
use MooseX::InsideOut::Role::Meta::Instance;

Moose::Exporter->setup_import_methods(
  also => [ 'Moose' ],
);

sub init_meta {
  shift;
  my %p = @_;
  Moose->init_meta(%p);
  Moose::Util::MetaRole::apply_metaroles(
    for             => $p{for_class},
    class_metaroles => {
        instance => [ 'MooseX::InsideOut::Role::Meta::Instance' ],
    },
  );
}

1;



__END__