From 1b0d4636fd93e148c53d9e9fd5888255a2e9a89b Mon Sep 17 00:00:00 2001 From: Ben Kaufman Date: Mon, 17 Jul 2017 11:12:18 -0700 Subject: [PATCH 1/2] Direct call to _build_server($self) as default for server Next step will be to put the actual logic in to the default correctly, then comment out / remove the _build_server sub all together. --- lib/WebService/DNSMadeEasy/Client.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/WebService/DNSMadeEasy/Client.pm b/lib/WebService/DNSMadeEasy/Client.pm index 675cef9..873e34f 100644 --- a/lib/WebService/DNSMadeEasy/Client.pm +++ b/lib/WebService/DNSMadeEasy/Client.pm @@ -12,7 +12,10 @@ has api_key => (is => 'rw', required => 1); has secret => (is => 'rw', required => 1); has user_agent_header => (is => 'rw', required => 1); has sandbox => (is => 'rw', default => sub { 0 }); -has '+server' => (builder => 1, lazy => 1); +has '+server' => (default => sub { + my $self = shift; + return _build_server($self); +}); sub _build_server { my ($self) = @_; From 941746c8fb3ca683718ece83ae153dc5ef64ceea Mon Sep 17 00:00:00 2001 From: Ben Kaufman Date: Thu, 20 Jul 2017 10:00:18 -0700 Subject: [PATCH 2/2] Removed the builder for server. Only using default now --- lib/WebService/DNSMadeEasy/Client.pm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/WebService/DNSMadeEasy/Client.pm b/lib/WebService/DNSMadeEasy/Client.pm index 873e34f..52bc59f 100644 --- a/lib/WebService/DNSMadeEasy/Client.pm +++ b/lib/WebService/DNSMadeEasy/Client.pm @@ -14,15 +14,10 @@ has user_agent_header => (is => 'rw', required => 1); has sandbox => (is => 'rw', default => sub { 0 }); has '+server' => (default => sub { my $self = shift; - return _build_server($self); -}); - -sub _build_server { - my ($self) = @_; return $self->sandbox ? "https://api.sandbox.dnsmadeeasy.com/V2.0" : "https://api.dnsmadeeasy.com/V2.0"; -} +}); sub default_headers { my ($self, $date) = @_;