ArrayBasedStorage - An example of an Array based instance storage


Moose documentation  | view source Contained in the Moose distribution.

Index


NAME

Top

ArrayBasedStorage - An example of an Array based instance storage

SYNOPSIS

Top

  package Foo;

  use metaclass (
    ':instance_metaclass'  => 'ArrayBasedStorage::Instance'
  );

  __PACKAGE__->meta->add_attribute('foo' => (
      reader => 'get_foo',
      writer => 'set_foo'
  ));    

  sub new  {
      my $class = shift;
      $class->meta->new_object(@_);
  } 

  # now you can just use the class as normal

DESCRIPTION

Top

This is a proof of concept using the Instance sub-protocol which uses ARRAY refs to store the instance data.

This is very similar now to the InsideOutClass example, and in fact, they both share the exact same test suite, with the only difference being the Instance metaclass they use.

AUTHORS

Top

Stevan Little <stevan@iinteractive.com>

Yuval Kogman <nothingmuch@woobling.com>

SEE ALSO

Top

COPYRIGHT AND LICENSE

Top


Moose documentation  | view source Contained in the Moose distribution.