Skip to content

Commit

Permalink
Review zone records implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jacegu committed Mar 7, 2016
1 parent b983047 commit 0fdee14
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/dnsimple/client/zones_records.rb
Expand Up @@ -60,8 +60,7 @@ def all_records(account_id, zone_id, options = {})
# @raise [Dnsimple::RequestError]
def create_record(account_id, zone_id, attributes = {}, options = {})
Extra.validate_mandatory_attributes(attributes, [:type, :name, :content])
options = options.merge(attributes)
response = client.post(Client.versioned("/%s/zones/%s/records" % [account_id, zone_id]), options)
response = client.post(Client.versioned("/%s/zones/%s/records" % [account_id, zone_id]), attributes, options)

Dnsimple::Response.new(response, Struct::Record.new(response["data"]))
end
Expand Down Expand Up @@ -98,8 +97,7 @@ def record(account_id, zone_id, record_id, options = {})
# @raise [Dnsimple::NotFoundError]
# @raise [Dnsimple::RequestError]
def update_record(account_id, zone_id, record_id, attributes = {}, options = {})
options = options.merge(attributes)
response = client.patch(Client.versioned("/%s/zones/%s/records/%s" % [account_id, zone_id, record_id]), options)
response = client.patch(Client.versioned("/%s/zones/%s/records/%s" % [account_id, zone_id, record_id]), attributes, options)

Dnsimple::Response.new(response, Struct::Record.new(response["data"]))
end
Expand All @@ -119,7 +117,7 @@ def update_record(account_id, zone_id, record_id, attributes = {}, options = {})
# @raise [Dnsimple::NotFoundError]
# @raise [Dnsimple::RequestError]
def delete_record(account_id, zone_id, record_id, options = {})
response = client.delete(Client.versioned("/%s/zones/%s/records/%s" % [account_id, zone_id, record_id]), options)
response = client.delete(Client.versioned("/%s/zones/%s/records/%s" % [account_id, zone_id, record_id]), {}, options)

Dnsimple::Response.new(response, nil)
end
Expand Down

0 comments on commit 0fdee14

Please sign in to comment.