MooX::Rebuild(3pm)

MooX::Rebuild3pm

Rebuild your moo objects.

Usage

    package Foo;
    use Moo;
    with 'MooX::Rebuild';
    has get_bar => (
        is       => 'ro',
        init_arg => 'bar',
    );
    
    my $foo1 = Foo->new( bar => 'lala' );
    my $foo2 = $foo1->rebuild();
    print $foo2->get_bar(); # lala

Overview

Make copies of Moo objects using the same arguments used to create the original objects.

This Moo role depends on, and uses, the MooX::BuildArgs role in order to capture the original arguments used to create an object.

Methods

rebuild

    my $clone   = $object->rebuild();
    my $similar = $object->rebuild( %extra_args );

Creates a new instance in the same class as the source object and using the same arguments used to make the source object.

Support

See "SUPPORT" in MooX::BuildArgs.

Releases

5 releases since Debian 9 (Stretch); the text changed 3 times.

  1. 9
  2. 10
  3. 11–12
  4. 13

Authors

See "AUTHORS" in MooX::BuildArgs.

License

See "LICENSE" in MooX::BuildArgs.

From libmoox-buildargs-perl 0.08-4 in Debian 13 (Trixie). Parsed by carta from the page's man source.