1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/dns/models/dnsimple/zones.rb

30 lines
534 B
Ruby
Raw Normal View History

2011-02-24 20:14:50 -05:00
require 'fog/core/collection'
require 'fog/dns/models/dnsimple/zone'
module Fog
module DNSimple
class DNS
class Zones < Fog::Collection
model Fog::DNSimple::DNS::Zone
def all
clear
data = connection.list_domains.body.map {|zone| zone['domain']}
load(data)
2011-02-24 20:14:50 -05:00
end
def get(zone_id)
2011-02-25 14:25:59 -05:00
data = connection.get_domain(zone_id).body['domain']
2011-02-25 00:13:16 -05:00
new(data)
rescue Excon::Errors::NotFound
2011-02-24 20:14:50 -05:00
nil
end
end
end
end
end