Class: Fog::DNS

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/dns.rb

Class Method Summary collapse

Class Method Details

.new(attributes) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fog/dns.rb', line 4

def self.new(attributes)
  attributes = attributes.dup # prevent delete from having side effects
  case provider = attributes[:provider] # attributes.delete(:provider)
  when 'AWS'
    require 'fog/dns/aws'
    Fog::AWS::DNS.new(attributes)
  when 'Bluebox'
    require 'fog/dns/bluebox'
    Fog::Bluebox::DNS.new(attributes)
  when 'DNSimple'
    require 'fog/dns/dnsimple'
    Fog::DNSimple::DNS.new(attributes)
  when 'Linode'
    require 'fog/dns/linode'
    Fog::Linode::DNS.new(attributes)
  when 'Slicehost'
    require 'fog/dns/slicehost'
    Fog::Slicehost::DNS.new(attributes)
  when 'Zerigo'
    require 'fog/dns/zerigo'
    Fog::Zerigo::DNS.new(attributes)
  else
    raise ArgumentError.new("#{provider} is not a recognized dns provider")
  end
end