Many times they support reading from a file, but often
times they expect to receive data (e.g. L<JSON::PP>). Other times
modules an be OK with both, and even accept I<filehandles>.
=item *
Deciding
$chars_not_octets = $asset->decoded_as($some_encoding);
# parse JSON on the fly
my $data_structure = $asset->parsed_as_json;
# initializing with a filehandle and then getting a filehandle
decoding the raw data as C<UTF-8>
=item *
L</parsed_as_json> decodes the data as JSON and provides the resulting data
structure back (L<JSON::PP> is used for parsing).
=back
=head2 Useability
Wh
unavailability of C<$something>.
=head2 B<< parsed_as_json >>
my $perl_data_structure = $asset->parsed_as_json
Treat the raw data as a JSON string and get back the data it represents.
=head2 B<
ehandle || $self->has_raw_ref || $self->has_file;
}
sub parsed_as_json ($self) {
require JSON::PP;
return JSON::PP::decode_json($self->raw_data);
}
sub persistent_file ($self) {
return $sel
-no_match_vars >;
use experimental qw< signatures >;
{ our $VERSION = '0.007001' }
use JSON::PP qw< decode_json >;
use Data::Resolver::Asset ();
use Exporter qw< import >;
my @FACTORIES = qw<
gene
--------------------------------------------
# Factories
sub generate ($spec) {
$spec = decode_json($spec) unless ref($spec);
my %args = $spec->%*;
my $package = delete($args{'-package'}) //