Mojolicious::Plugin::AssetPack::Asset - An asset
Mojolicious::Plugin::AssetPack::Asset represents an asset.
use Mojolicious::Plugin::AssetPack::Asset; my $asset = Mojolicious::Plugin::AssetPack::Asset->new(url => "...");
$str = $self->checksum; $self = $self->checksum($str);
The checksum of "content".
$str = $self->format; $self = $self->format($str);
The format of "content". Defaults to the extension of "url" or empty string.
$bool = $self->minified; $self = $self->minified($bool);
Will be set to true if either "url" contains "min" or if a pipe has minified "content".
$epoch = $self->mtime; $self = $self->mtime($epoch);
Holds the modification time of "content".
$str = $self->name;
Returns the last part of l</url> without extension.
$str = $self->url;
Returns the location of the asset.
$bytes = $self->content; $self = $self->content($bytes); $self = $self->content(Mojo::Asset::Memory->new);
Used to get or set the content of this asset. The default will be built from passing "url" to "file" in Mojolicious::Plugin::AssetPack::Store.
See "get_chunk" in Mojo::Asset.
$str = $self->path;
Returns the path to the asset, if it exists on disk.
See "size" in Mojo::Asset.
$self = $self->FROM_JSON($hash_ref);
The opposite of "TO_JSON". Will set the read/write "ATTRIBUTES" from the values in $hash_ref.
$hash_ref
$hash_ref = $self->FROM_JSON;
The opposite of "FROM_JSON". Will generate a hash ref from "ATTRIBUTES".
Mojolicious::Plugin::AssetPack.
To install Mojolicious::Plugin::AssetPack, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::AssetPack
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::AssetPack
For more information on module installation, please visit the detailed CPAN module installation guide.