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>
Lists ALL the TLDs in DNSimple.
-
#list_tlds(options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::Tld>
Lists the TLDs available for registration.
-
#tld(tld, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::Tld>
Gets a TLD details.
-
#tld_extended_attributes(tld, options = {}) ⇒ Dnsimple::CollectionResponse<Dnsimple::Struct::ExtendedAttribute>
Gets the extended attributes for a TLD.
Instance Method Details
#all_tlds(options = {}) ⇒ Dnsimple::CollectionResponse<Dnsimple::Struct::Tld>
Lists ALL the TLDs in DNSimple.
This method is similar to Dnsimple::Client#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.
54 55 56 |
# File 'lib/dnsimple/client/tlds.rb', line 54 def all_tlds( = {}) paginate(:list_tlds, ) end |
#list_tlds(options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::Tld>
Lists the TLDs available for registration
27 28 29 30 31 |
# File 'lib/dnsimple/client/tlds.rb', line 27 def list_tlds( = {}) response = client.get(Client.versioned("/tlds"), Options::ListOptions.new()) Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Tld.new(r) }) end |
#tld(tld, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::Tld>
Gets a TLD details
71 72 73 74 75 |
# File 'lib/dnsimple/client/tlds.rb', line 71 def tld(tld, = {}) response = client.get(Client.versioned("/tlds/%s" % tld), ) Dnsimple::Response.new(response, Struct::Tld.new(response["data"])) end |
#tld_extended_attributes(tld, options = {}) ⇒ Dnsimple::CollectionResponse<Dnsimple::Struct::ExtendedAttribute>
Gets the extended attributes for a TLD.
90 91 92 93 94 |
# File 'lib/dnsimple/client/tlds.rb', line 90 def tld_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 |