Module: Dnsimple::Client::Tlds
- Included in:
- TldsService
- Defined in:
- lib/dnsimple/client/tlds.rb
Instance Method Summary collapse
-
#all_tlds(options = {}) ⇒ Dnsimple::CollectionResponse<Dnsimple::Struct::Tld>
(also: #all)
Lists ALL the TLDs in DNSimple.
-
#extended_attributes(tld, options = {}) ⇒ Dnsimple::CollectionResponse<Dnsimple::Struct::ExtendedAttribute>
Gets the extended attributes for a TLD.
-
#tld(tld, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::Tld>
Gets a TLD’s details.
-
#tlds(options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::Tld>
(also: #list, #list_tlds)
Lists the tlds available for registration.
Instance Method Details
#all_tlds(options = {}) ⇒ Dnsimple::CollectionResponse<Dnsimple::Struct::Tld> Also known as: all
Lists ALL the TLDs in DNSimple.
This method is similar to #tlds, but instead of returning the results of a specific page it iterates all the pages and returns the entire collection.
Please use this method carefully, as fetching the entire collection will increase the number of requests you send to the API server and you may eventually risk to hit the throttle limit.
44 45 46 |
# File 'lib/dnsimple/client/tlds.rb', line 44 def all_tlds( = {}) paginate(:tlds, ) end |
#extended_attributes(tld, options = {}) ⇒ Dnsimple::CollectionResponse<Dnsimple::Struct::ExtendedAttribute>
Gets the extended attributes for a TLD.
81 82 83 84 85 |
# File 'lib/dnsimple/client/tlds.rb', line 81 def extended_attributes(tld, = {}) response = client.get(Client.versioned("/tlds/%s/extended_attributes" % tld), ) Dnsimple::CollectionResponse.new(response, response["data"].map { |r| Struct::ExtendedAttribute.new(r) }) end |
#tld(tld, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::Tld>
Gets a TLD’s details
62 63 64 65 66 |
# File 'lib/dnsimple/client/tlds.rb', line 62 def tld(tld, = {}) response = client.get(Client.versioned("/tlds/%s" % tld), ) Dnsimple::Response.new(response, Struct::Tld.new(response["data"])) end |
#tlds(options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::Tld> Also known as: list, list_tlds
Lists the tlds available for registration
18 19 20 21 22 |
# File 'lib/dnsimple/client/tlds.rb', line 18 def tlds( = {}) response = client.get(Client.versioned("/tlds"), ) Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Tld.new(r) }) end |