Mojo::Asset::Memory(3)User Contributed Perl DocumentatioMojo::Asset::Memory(3)NAMEMojo::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;
DESCRIPTIONMojo::Asset::Memory is a container for in-memory assets.
METHODSMojo::Asset::Memory inherits all methods from Mojo::Asset and
implements the following new ones.
"new"
my $asset = Mojo::Asset::Memory->new;
Construct a new Mojo::Asset::Memory object.
"add_chunk"
$asset = $asset->add_chunk('foo bar baz');
Add chunk of data to asset.
"contains"
my $position = $asset->contains('bar');
Check if asset contains a specific string.
"get_chunk"
my $chunk = $asset->get_chunk($offset);
Get chunk of data starting from a specific position.
"move_to"
$asset = $asset->move_to('/foo/bar/baz.txt');
Move asset data into a specific file.
"size"
my $size = $asset->size;
Size of asset data in bytes.
"slurp"
my $string = $file->slurp;
Read all asset data at once.
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.1 2011-09-11 Mojo::Asset::Memory(3)