From a8268e90880da12696205238040a6e0b27ac47a7 Mon Sep 17 00:00:00 2001 From: Jose Luis Salas Date: Sat, 11 Jan 2014 18:55:08 +0100 Subject: [PATCH] DNSimple get_domain also accepts domain name As the real DNSimple behaviour, get_domain also accept a string argument. --- lib/fog/dnsimple/requests/dns/get_domain.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/fog/dnsimple/requests/dns/get_domain.rb b/lib/fog/dnsimple/requests/dns/get_domain.rb index 53300e440..a3f320810 100644 --- a/lib/fog/dnsimple/requests/dns/get_domain.rb +++ b/lib/fog/dnsimple/requests/dns/get_domain.rb @@ -36,7 +36,9 @@ module Fog class Mock def get_domain(id) - domain = self.data[:domains].detect { |domain| domain["domain"]["id"] == id } + domain = self.data[:domains].detect do |domain| + domain["domain"]["id"] == id || domain["domain"]["name"] == id + end response = Excon::Response.new response.status = 200 response.body = domain @@ -46,4 +48,4 @@ module Fog end end end -end +end \ No newline at end of file