Marquee Marquee::Stash - stash

TABLE OF CONTENTS

NAME

Marquee::Stash - stash

SYNOPSIS

use Marquee::Stash;

my $stash = Marquee::Stash->new(a => 'b', c => 'd');
is_deeply $stash->get(), {a => 'b', c => 'd'};

$stash->set(e => 'f');
is_deeply $stash->get(), {a => 'b', c => 'd', e => 'f'};

$stash->set(e => 'g');
is_deeply $stash->get(), {a => 'b', c => 'd', e => 'g'};

my $clone = $stash->clone(h => 'i');
is_deeply $clone->get(), {a => 'b', c => 'd', e => 'g', h => 'i'};
is_deeply $stash->get(), {a => 'b', c => 'd', e => 'g'};

DESCRIPTION

A class represents stash.

CLASS METHODS

Marquee::Stash implements the following class methods.

new

my $stash = Marquee::Stash->new;
my $stash = Marquee::Stash->new(foo => $foo_value, bar => $bar_value);

INSTANCE METHODS

Marquee::Stash implements the following instance methods.

get

Get stash value for given name.

my $hash_ref = $stash->get();
my $value    = $stash->get('key');

set

Set stash values with given hash or hash reference.

$stash->set(foo => $foo_value, bar => $bar_value);
$stash->set($hash_ref);

clone

Clones stash with given hash or hash reference merged.

my $clone = $stash->clone;                      # clone
my $clone = $stash->clone(foo => $foo_value);   # clone and merge
my $clone = $stash->clone($hash_ref);           # clone and merge

SEE ALSO

Marquee, Mojolicious