Skip to content

Commit

Permalink
comments, small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sosedoff committed Aug 31, 2011
1 parent c36cc2f commit 97bf754
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/clouddns/client/domains.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,23 @@ def update_domain(domain)

# Delete an existing domain. Returns an AsyncResponse instance
#
# domain - CloudDns::Domain instance
# domain - CloudDns::Domain instance or domain ID
#
# @return [Hash]
#
def delete_domain(domain)
options = {'deleteSubdomains' => true}
async_response(delete("/domains/#{domain.id}", options))
async_response(delete("/domains/#{domain_id(domain)}", options))
end

# Export domain contents
#
# domain - CloudDns::Domain instance
# domain - CloudDns::Domain instance or domain ID
#
# @return [CloudDns::ExportRecord]
#
def export_domain(domain)
resp = get("/domains/#{domain.id}/export")
resp = get("/domains/#{domain_id(domain)}/export")
data = async_response(resp)
ExportRecord.new(data)
end
Expand Down
4 changes: 4 additions & 0 deletions lib/clouddns/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ def delete
new? ? false : @client.delete_domain(self)
end

# Export domain data
#
# @return [CloudDns::ExportRecord]
#
def export
@client.export_domain(self)
end
Expand Down
1 change: 1 addition & 0 deletions lib/clouddns/record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def initialize(client, data={})
raise ArgumentError, "CloudDns::Client required!"
end

# Check if we've got all the data
raise InvalidRecord, "Record :name required!" if @name.empty?
raise InvalidRecord, "Record :type required!" if @type.empty?
raise InvalidRecord, "Record :data required!" if @data.empty?
Expand Down

0 comments on commit 97bf754

Please sign in to comment.