NAME

Mojo::Asset::Memory - In-Memory Asset

SYNOPSIS

    use Mojo::Asset::Memory;

    my $asset = Mojo::Asset::Memory->new;
    $asset->add_chunk('foo bar baz');
    print $asset->slurp;

DESCRIPTION

Mojo::Asset::Memory is a container for in-memory assets.

METHODS

Mojo::Asset::Memory inherits all methods from Mojo::Asset and implements the following new ones.

new

    my $asset = Mojo::Asset::Memory->new;

add_chunk

    $asset = $asset->add_chunk('foo bar baz');

contains

    my $position = $asset->contains('bar');

get_chunk

    my $chunk = $asset->get_chunk($offset);

move_to

    $asset = $asset->move_to('/foo/bar/baz.txt');

size

    my $size = $asset->size;

slurp

    my $string = $file->slurp;