package WWW::PGXN::Mirror; use 5.8.1; use strict; our $VERSION = v0.12.3; BEGIN { for my $attr (qw( uri frequency location organization timezone bandwidth src rsync notes )) { no strict 'refs'; *{$attr} = sub { shift->{$attr} }; } } sub new { my ($class, $data) = @_; bless $data, $class; } sub email { my ($host, $user) = split /[|]/ => shift->{email}; return "$user\@$host"; } 1; __END__ =head1 Name WWW::PGXN::Mirror - Mirror metadata fetched from PGXN =head1 Synopsis my $pgxn = WWW::PGXN->new( url => 'http://api.pgxn.org/' ); for my $mirror ($pgxn->mirrors) { say $mirror->url; } =head1 Description This module represents PGXN mirror metadata fetched from PGXN>. It is not intended to be constructed directly, but via the L method of L. =head1 Interface =begin private =head2 Constructor =head3 C my $mirror = WWW::PGXN::Mirror->new($data); Construct a new WWW::PGXN::Mirror object. The argument must be the data fetched. =end private =head2 Instance Accessors =head3 C my $uri = $mirror->uri; $mirror->uri($uri); The URI of the mirror. =head3 C my $bandwidth = $mirror->bandwidth; $mirror->bandwidth($bandwidth); The mirror's bandwidth. =head3 C my $frequency = $mirror->frequency; $mirror->frequency($frequency); A description of how frequently the mirror updates. =head3 C my $location = $mirror->location; $mirror->location($location); The location of the mirror. =head3 C my $notes = $mirror->notes; $mirror->notes($notes); Notes about the mirror. =head3 C my $organization = $mirror->organization; $mirror->organization($organization); The name of the organization hosting the mirror. =head3 C my $email = $mirror->email; $mirror->email($email); The email address of the contact responsible for the mirror.. =head3 C my $src = $mirror->src; $mirror->src($src); The rsync URL that the mirror updates from. =head3 C my $rsync = $mirror->rsync; $mirror->rsync($rsync); The rsync URL the mirror offers for other mirrors to update from. If false, the mirror provides no rsync URL of its own. =head3 C my $timezone = $mirror->timezone; $mirror->timezone($timezone); The time zone in which the mirror lives. =head1 See Also =over =item * L The main class to communicate with a PGXN mirror or API server. =back =head1 Support This module is stored in an open L. Feel free to fork and contribute! Please file bug reports via L or by sending mail to L. =head1 Author David E. Wheeler =head1 Copyright and License Copyright (c) 2011 David E. Wheeler. Some Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut