blib/lib/WWW/eNom/DomainAvailability.pm

filter: Statementstmt 100% 24 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 30 / 30 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Net/eNom.pm ↑ Summary blib/lib/WWW/eNom/PrivateNameServer.pm »
1 package WWW::eNom::DomainAvailability;
2  
3 48 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 48 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 48 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 48 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 48 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 48 ▶use WWW::eNom::Types qw( Bool DomainName );
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 48 our $VERSION = 'v2.6.0'; # VERSION
13 # ABSTRACT: eNom Domain Availability Response
14  
15 48 has 'name' => (
16 is => 'ro',
17 isa => DomainName,
18 required => 1,
19 );
20  
21 48 has 'is_available' => (
22 is => 'ro',
23 isa => Bool,
24 required => 1,
25 );
26  
27 48 with 'WWW::eNom::Role::ParseDomain';
28  
29 48 __PACKAGE__->meta->make_immutable;
30  
31 48 1;
32  
33 __END__
34 =pod
35  
36 =head1 NAME
37  
38 WWW::eNom::DomainAvailability
39  
40 =head1 SYNOPSIS
41  
42 use WWW::eNom;
43  
44 my $eNom = WWW::eNom->new( ... );
45  
46 my $domain_availabilities = $eNom->check_domain_availability(
47 slds => [qw( cpan drzigman brainstormincubator ],
48 tlds => [qw( com net org )],
49 suggestions => 0,
50 );
51  
52 for my $domain_availability (@{ $domain_availabilities }) {
53 if ( $domain_availability->is_available ) {
54 print 'Domain: ' . $domain_availability->name . " is available! :) \n";
55 }
56 else {
57 print 'Domain: ' . $domain_availability->name . " is not available! :( \n";
58 }
59 }
60  
61 =head1 DESCRIPTION
62  
63 Contains details about the availability of a domain.
64  
65 =head1 ATTRIBUTES
66  
67 =head2 B<name>
68  
69 The full domain name (test-domain.com).
70  
71 =head2 B<is_available>
72  
73 Boolean indicating if this domain is available for registration.
74  
75 =head2 sld
76  
77 The portion of the domain name excluding the public_suffix, (test-domain).
78  
79 =head2 public_suffix
80  
81 The "root" of the domain (.com). There is an alias of tld to this attribute.
82  
83 B<NOTE> For domains like test-domain.co.uk the public_suffix is .co.uk. The public suffix is what is available for someone to actually register. For additional information between the distinction between Top Level Domain and Public Suffix please see L<https://publicsuffix.org/learn/>
84  
85 =cut
« blib/lib/Net/eNom.pm ↑ Summary blib/lib/WWW/eNom/PrivateNameServer.pm »