Data::Object::Role::Stashable

Stashable Role for Perl 5

method: stash

package Example;

use Moo;

with 'Data::Object::Role::Stashable';

package main;

my $example = Example->new;

This package provides methods for stashing data within the object.

The stash method is used to fetch and stash named values associated with the object. Calling this method without arguments returns all values.

stash(Maybe[Str] $key, Maybe[Any] $value) : Any

=example-1 stash

# given: synopsis

my $result = $example->stash;

[$result, $example]

=example-2 stash

# given: synopsis

my $result = $example->stash(time => time);

[$result, $example]

=example-3 stash

# given: synopsis

my $result = $example->stash('time');

[$result, $example]

7 POD Errors

The following errors were encountered while parsing the POD:

Around line 10:

Unknown directive: =name

Around line 16:

Unknown directive: =abstract

Around line 22:

Unknown directive: =includes

Around line 28:

Unknown directive: =synopsis

Around line 42:

Unknown directive: =description

Around line 48:

Unknown directive: =method

Around line 53:

Unknown directive: =signature