NAME

Mojo::File::Memory - In-Memory File

SYNOPSIS

use Mojo::File::Memory;

my $file = Mojo::File::Memory->new('Hello!');
$file->add_chunk('World!');
print $file->slurp;

DESCRIPTION

Mojo::File::Memory is a container for in-memory files.

ATTRIBUTES

content

my $handle = $file->content;
$file      = $file->content('Hello World!');

METHODS

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

new

my $file = Mojo::File::Memory->new('foo bar');

add_chunk

$file = $file->add_chunk('test 123');

contains

my $contains = $file->contains('random string');

get_chunk

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

length

my $length = $file->length;

slurp

my $string = $file->slurp;