Skip to content

Commit

Permalink
Cleanup docs
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Jan 7, 2016
1 parent dde875a commit 34803b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions lib/dnsimple/client/domains.rb
Expand Up @@ -16,6 +16,7 @@ module Domains
# @param [Fixnum] account_id the account ID
# @param [Hash] options the filtering and sorting option
# @return [Dnsimple::PaginatedResponse<Dnsimple::Struct::Domain>]
#
# @raise [Dnsimple::RequestError]
def domains(account_id, options = {})
response = client.get(Client.versioned("/%s/domains" % [account_id]), options)
Expand All @@ -39,6 +40,7 @@ def domains(account_id, options = {})
# @param [Fixnum] account_id the account ID
# @param [Hash] options the filtering and sorting option
# @return [Dnsimple::CollectionResponse<Dnsimple::Struct::Domain>]
#
# @raise [Dnsimple::RequestError]
def all_domains(account_id, options = {})
paginate(:domains, account_id, options)
Expand Down Expand Up @@ -69,14 +71,14 @@ def create_domain(account_id, attributes = {}, options = {})
# @see https://developer.dnsimple.com/v2/domains/#get
#
# @param [Fixnum] account_id the account ID
# @param [#to_s] domain The domain id or domain name.
# @param [#to_s] domain_id The domain id or domain name.
# @param [Hash] options
# @return [Dnsimple::Response<Dnsimple::Struct::Domain>]
#
# @raise [Dnsimple::NotFoundError]
# @raise [Dnsimple::RequestError]
def domain(account_id, domain, options = {})
response = client.get(Client.versioned("/%s/domains/%s" % [account_id, domain]), options)
def domain(account_id, domain_id, options = {})
response = client.get(Client.versioned("/%s/domains/%s" % [account_id, domain_id]), options)

Dnsimple::Response.new(response, Struct::Domain.new(response["data"]))
end
Expand All @@ -88,14 +90,14 @@ def domain(account_id, domain, options = {})
# @see https://developer.dnsimple.com/v2/domains/#delete
#
# @param [Fixnum] account_id the account ID
# @param [#to_s] domain The domain id or domain name.
# @param [#to_s] domain_id The domain id or domain name.
# @param [Hash] options
# @return [Dnsimple::Response<nil>]
#
# @raise [Dnsimple::NotFoundError]
# @raise [Dnsimple::RequestError]
def delete_domain(account_id, domain, options = {})
response = client.delete(Client.versioned("/%s/domains/%s" % [account_id, domain]), options)
def delete_domain(account_id, domain_id, options = {})
response = client.delete(Client.versioned("/%s/domains/%s" % [account_id, domain_id]), options)

Dnsimple::Response.new(response, nil)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/dnsimple/client/domains_spec.rb
Expand Up @@ -126,7 +126,7 @@
expect(result.updated_at).to eq("2015-12-09T00:20:56.056Z")
end

context "when something does not exist" do
context "when the domain does not exist" do
it "raises NotFoundError" do
stub_request(:get, %r[/v2])
.to_return(read_fixture("notfound-domain.http"))
Expand Down Expand Up @@ -161,7 +161,7 @@
expect(result).to be_nil
end

context "when something does not exist" do
context "when the domain does not exist" do
it "raises NotFoundError" do
stub_request(:delete, %r[/v2])
.to_return(read_fixture("notfound-domain.http"))
Expand Down

0 comments on commit 34803b4

Please sign in to comment.