NAME

Net::API::CPAN::Mirrors - Meta CPAN API Mirrors Class

SYNOPSIS

use Net::API::CPAN::Mirrors;
my $obj = Net::API::CPAN::Mirrors->new( {
  mirrors => [
    {
      ccode => "zz",
      city => "Everywhere",
      contact => [
        {
          contact_site => "perl.org",
          contact_user => "cpan",
        },
      ],
      continent => "Global",
      country => "Global",
      distance => undef,
      dnsrr => "N",
      freq => "instant",
      http => "http://www.cpan.org/",
      inceptdate => "2021-04-09T00:00:00",
      location => [
        0,
        0,
      ],
      name => "www.cpan.org",
      org => "Global CPAN CDN",
      src => "rsync://cpan-rsync.perl.org/CPAN/",
      tz => 0,
    },
  ],
  took => 2,
  total => 1,
} ) || die( Net::API::CPAN::Mirrors->error );

my $array = $obj->mirrors;
my $str = $obj->object;
my $num = $obj->took;
my $num = $obj->total;

VERSION

v0.1.0

DESCRIPTION

This class serves to retrieve and manipulate mirrors.

It inherits from Net::API::CPAN::Generic

CONSTRUCTOR

new

Provided with an hash or hash reference of parameters, and this instantiates a new Net::API::CPAN::Mirrors object.

The parameters that can be provided bear the same name and supports the same values as the methods below.

METHODS

mirrors

$obj->mirrors( [
  {
    ccode => "zz",
    city => "Everywhere",
    contact => [
      {
        contact_site => "perl.org",
        contact_user => "cpan",
      },
    ],
    continent => "Global",
    country => "Global",
    distance => undef,
    dnsrr => "N",
    freq => "instant",
    http => "http://www.cpan.org/",
    inceptdate => "2021-04-09T00:00:00",
    location => [
      0,
      0,
    ],
    name => "www.cpan.org",
    org => "Global CPAN CDN",
    src => "rsync://cpan-rsync.perl.org/CPAN/",
    tz => 0,
  },
] );
my $array = $obj->mirrors;

Sets or gets an array of Net::API::CPAN::Mirror objects, or creates an Net::API::CPAN::Mirror instance for each mirrors provided in the array, and returns an array object, even if no value was provided.

object

Returns the object type for this class, which is mirrors

took

$obj->took(2);
my $number = $obj->took;

Sets or gets an integer value, and returns a number object or undef if no value is set.

total

$obj->total(1);
my $number = $obj->total;

Sets or gets an integer value, and returns a number object or undef if no value is set.

API SAMPLE

{
   "mirrors" : [
      {
         "ccode" : "zz",
         "city" : "Everywhere",
         "contact" : [
            {
               "contact_site" : "perl.org",
               "contact_user" : "cpan"
            }
         ],
         "continent" : "Global",
         "country" : "Global",
         "distance" : null,
         "dnsrr" : "N",
         "freq" : "instant",
         "http" : "http://www.cpan.org/",
         "inceptdate" : "2021-04-09T00:00:00",
         "location" : [
            0,
            0
         ],
         "name" : "www.cpan.org",
         "org" : "Global CPAN CDN",
         "src" : "rsync://cpan-rsync.perl.org/CPAN/",
         "tz" : "0"
      }
   ],
   "took" : 2,
   "total" : 1
}

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Net::API::CPAN, Net::API::CPAN::Activity, Net::API::CPAN::Author, Net::API::CPAN::Changes, Net::API::CPAN::Changes::Release, Net::API::CPAN::Contributor, Net::API::CPAN::Cover, Net::API::CPAN::Diff, Net::API::CPAN::Distribution, Net::API::CPAN::DownloadUrl, Net::API::CPAN::Favorite, Net::API::CPAN::File, Net::API::CPAN::Module, Net::API::CPAN::Package, Net::API::CPAN::Permission, Net::API::CPAN::Rating, Net::API::CPAN::Release

MetaCPAN::API, MetaCPAN::Client

https://github.com/metacpan/metacpan-api/blob/master/docs/API-docs.md

COPYRIGHT & LICENSE

Copyright(c) 2023 DEGUEST Pte. Ltd.

All rights reserved

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.