MetaCPAN-Client
view release on metacpan or search on metacpan
lib/MetaCPAN/Client/Release.pm view on Meta::CPAN
use strict;
use warnings;
package MetaCPAN::Client::Release;
# ABSTRACT: A Release data object
$MetaCPAN::Client::Release::VERSION = '2.042000';
use Moo;
use Ref::Util qw< is_hashref >;
use JSON::MaybeXS qw< decode_json >;
with 'MetaCPAN::Client::Role::Entity',
'MetaCPAN::Client::Role::HasUA';
my %known_fields = (
scalar => [qw<
abstract
archive
author
authorized
checksum_md5
checksum_sha256
date
deprecated
distribution
download_url
first
id
maturity
main_module
name
status
version
version_numified
>],
arrayref => [qw<
dependency
license
provides
>],
hashref => [qw<
metadata
resources
stat
tests
>],
);
my @known_fields =
map { @{ $known_fields{$_} } } qw< scalar arrayref hashref >;
foreach my $field (@known_fields) {
has $field => (
is => 'ro',
lazy => 1,
default => sub {
my $self = shift;
return $self->data->{$field};
},
);
}
sub _known_fields { return \%known_fields }
sub changes {
my $self = shift;
my $url = sprintf "https://fastapi.metacpan.org/changes/%s/%s", $self->author, $self->name;
( run in 0.807 second using v1.01-cache-2.11-cpan-39bf76dae61 )