1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[dnsimple] Updates reference to service

This commit is contained in:
Paul Thornthwaite 2012-12-22 23:28:30 +00:00
parent 245c3452a2
commit 3daa602f5f
4 changed files with 11 additions and 11 deletions

View file

@ -26,7 +26,7 @@ module Fog
end
def destroy
connection.delete_record(zone.domain, identity)
service.delete_record(zone.domain, identity)
true
end
@ -42,14 +42,14 @@ module Fog
# decide whether its a new record or update of an existing
if id.nil?
data = connection.create_record(zone.domain, name, type, value, options)
data = service.create_record(zone.domain, name, type, value, options)
else
options[:name] = name if name
options[:content] = value if value
options[:type] = type if type
data = connection.update_record(zone.domain, id, options)
data = service.update_record(zone.domain, id, options)
end
merge_attributes(data.body["record"])
true
end

View file

@ -14,13 +14,13 @@ module Fog
def all
requires :zone
clear
data = connection.list_records(zone.id).body.map {|record| record['record']}
data = service.list_records(zone.id).body.map {|record| record['record']}
load(data)
end
def get(record_id)
requires :zone
data = connection.get_record(zone.id, record_id).body["record"]
data = service.get_record(zone.id, record_id).body["record"]
new(data)
rescue Excon::Errors::NotFound
nil

View file

@ -14,7 +14,7 @@ module Fog
attribute :updated_at
def destroy
connection.delete_domain(identity)
service.delete_domain(identity)
true
end
@ -22,7 +22,7 @@ module Fog
@records ||= begin
Fog::DNS::DNSimple::Records.new(
:zone => self,
:connection => connection
:service => service
)
end
end
@ -38,7 +38,7 @@ module Fog
def save
requires :domain
data = connection.create_domain(domain).body["domain"]
data = service.create_domain(domain).body["domain"]
merge_attributes(data)
true
end

View file

@ -11,12 +11,12 @@ module Fog
def all
clear
data = connection.list_domains.body.map {|zone| zone['domain']}
data = service.list_domains.body.map {|zone| zone['domain']}
load(data)
end
def get(zone_id)
data = connection.get_domain(zone_id).body['domain']
data = service.get_domain(zone_id).body['domain']
new(data)
rescue Excon::Errors::NotFound
nil