Class: GandiV5::Domain::TLD
- Inherits:
-
Object
- Object
- GandiV5::Domain::TLD
- Includes:
- GandiV5::Data
- Defined in:
- lib/gandi_v5/domain/tld.rb
Overview
Information about a specific TLD (Top Level Domain).
Instance Attribute Summary collapse
-
#authinfo_for_transfer ⇒ Boolean
readonly
Whether authinfo is required for a transfer.
- #category ⇒ String readonly
-
#change_owner ⇒ Boolean
readonly
Whther changing owner is pemritted.
-
#corporate ⇒ Boolean
readonly
Whether this is a corporate TLD.
- #ext_trade ⇒ Boolean readonly
- #full_tld ⇒ String readonly
- #lock ⇒ Boolean readonly
- #name ⇒ String readonly
Class Method Summary collapse
-
.fetch(name) ⇒ GandiV5::Domain::TLD
Get TLD information.
-
.list ⇒ Object
List of available TLDs.
Methods included from GandiV5::Data
#from_gandi, included, #initialize, #to_gandi, #to_h, #values_at
Instance Attribute Details
#authinfo_for_transfer ⇒ Boolean (readonly)
Returns whether authinfo is required for a transfer.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/gandi_v5/domain/tld.rb', line 22 class TLD include GandiV5::Data members :name, :full_tld, :authinfo_for_transfer, :change_owner, :corporate, :ext_trade, :lock member :category, converter: GandiV5::Data::Converter::Symbol # List of available TLDs. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds # @return Array<GandiV5::Domain::TLD> # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.list GandiV5.get(url) .last .map { |tld| GandiV5::Domain::TLD.from_gandi tld } end # Get TLD information. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds-name # @param name [String, #to_s] the top level domain to get information for. # @return [GandiV5::Domain::TLD] # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.fetch(name) _response, data = GandiV5.get url(name) GandiV5::Domain::TLD.from_gandi data end private def self.url(name = nil) "#{BASE}domain/tlds" + (name ? "/#{CGI.escape name}" : '') end private_class_method :url end |
#category ⇒ String (readonly)
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/gandi_v5/domain/tld.rb', line 22 class TLD include GandiV5::Data members :name, :full_tld, :authinfo_for_transfer, :change_owner, :corporate, :ext_trade, :lock member :category, converter: GandiV5::Data::Converter::Symbol # List of available TLDs. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds # @return Array<GandiV5::Domain::TLD> # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.list GandiV5.get(url) .last .map { |tld| GandiV5::Domain::TLD.from_gandi tld } end # Get TLD information. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds-name # @param name [String, #to_s] the top level domain to get information for. # @return [GandiV5::Domain::TLD] # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.fetch(name) _response, data = GandiV5.get url(name) GandiV5::Domain::TLD.from_gandi data end private def self.url(name = nil) "#{BASE}domain/tlds" + (name ? "/#{CGI.escape name}" : '') end private_class_method :url end |
#change_owner ⇒ Boolean (readonly)
Returns whther changing owner is pemritted.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/gandi_v5/domain/tld.rb', line 22 class TLD include GandiV5::Data members :name, :full_tld, :authinfo_for_transfer, :change_owner, :corporate, :ext_trade, :lock member :category, converter: GandiV5::Data::Converter::Symbol # List of available TLDs. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds # @return Array<GandiV5::Domain::TLD> # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.list GandiV5.get(url) .last .map { |tld| GandiV5::Domain::TLD.from_gandi tld } end # Get TLD information. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds-name # @param name [String, #to_s] the top level domain to get information for. # @return [GandiV5::Domain::TLD] # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.fetch(name) _response, data = GandiV5.get url(name) GandiV5::Domain::TLD.from_gandi data end private def self.url(name = nil) "#{BASE}domain/tlds" + (name ? "/#{CGI.escape name}" : '') end private_class_method :url end |
#corporate ⇒ Boolean (readonly)
Returns whether this is a corporate TLD.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/gandi_v5/domain/tld.rb', line 22 class TLD include GandiV5::Data members :name, :full_tld, :authinfo_for_transfer, :change_owner, :corporate, :ext_trade, :lock member :category, converter: GandiV5::Data::Converter::Symbol # List of available TLDs. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds # @return Array<GandiV5::Domain::TLD> # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.list GandiV5.get(url) .last .map { |tld| GandiV5::Domain::TLD.from_gandi tld } end # Get TLD information. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds-name # @param name [String, #to_s] the top level domain to get information for. # @return [GandiV5::Domain::TLD] # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.fetch(name) _response, data = GandiV5.get url(name) GandiV5::Domain::TLD.from_gandi data end private def self.url(name = nil) "#{BASE}domain/tlds" + (name ? "/#{CGI.escape name}" : '') end private_class_method :url end |
#ext_trade ⇒ Boolean (readonly)
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/gandi_v5/domain/tld.rb', line 22 class TLD include GandiV5::Data members :name, :full_tld, :authinfo_for_transfer, :change_owner, :corporate, :ext_trade, :lock member :category, converter: GandiV5::Data::Converter::Symbol # List of available TLDs. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds # @return Array<GandiV5::Domain::TLD> # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.list GandiV5.get(url) .last .map { |tld| GandiV5::Domain::TLD.from_gandi tld } end # Get TLD information. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds-name # @param name [String, #to_s] the top level domain to get information for. # @return [GandiV5::Domain::TLD] # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.fetch(name) _response, data = GandiV5.get url(name) GandiV5::Domain::TLD.from_gandi data end private def self.url(name = nil) "#{BASE}domain/tlds" + (name ? "/#{CGI.escape name}" : '') end private_class_method :url end |
#full_tld ⇒ String (readonly)
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/gandi_v5/domain/tld.rb', line 22 class TLD include GandiV5::Data members :name, :full_tld, :authinfo_for_transfer, :change_owner, :corporate, :ext_trade, :lock member :category, converter: GandiV5::Data::Converter::Symbol # List of available TLDs. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds # @return Array<GandiV5::Domain::TLD> # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.list GandiV5.get(url) .last .map { |tld| GandiV5::Domain::TLD.from_gandi tld } end # Get TLD information. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds-name # @param name [String, #to_s] the top level domain to get information for. # @return [GandiV5::Domain::TLD] # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.fetch(name) _response, data = GandiV5.get url(name) GandiV5::Domain::TLD.from_gandi data end private def self.url(name = nil) "#{BASE}domain/tlds" + (name ? "/#{CGI.escape name}" : '') end private_class_method :url end |
#lock ⇒ Boolean (readonly)
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/gandi_v5/domain/tld.rb', line 22 class TLD include GandiV5::Data members :name, :full_tld, :authinfo_for_transfer, :change_owner, :corporate, :ext_trade, :lock member :category, converter: GandiV5::Data::Converter::Symbol # List of available TLDs. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds # @return Array<GandiV5::Domain::TLD> # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.list GandiV5.get(url) .last .map { |tld| GandiV5::Domain::TLD.from_gandi tld } end # Get TLD information. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds-name # @param name [String, #to_s] the top level domain to get information for. # @return [GandiV5::Domain::TLD] # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.fetch(name) _response, data = GandiV5.get url(name) GandiV5::Domain::TLD.from_gandi data end private def self.url(name = nil) "#{BASE}domain/tlds" + (name ? "/#{CGI.escape name}" : '') end private_class_method :url end |
#name ⇒ String (readonly)
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/gandi_v5/domain/tld.rb', line 22 class TLD include GandiV5::Data members :name, :full_tld, :authinfo_for_transfer, :change_owner, :corporate, :ext_trade, :lock member :category, converter: GandiV5::Data::Converter::Symbol # List of available TLDs. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds # @return Array<GandiV5::Domain::TLD> # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.list GandiV5.get(url) .last .map { |tld| GandiV5::Domain::TLD.from_gandi tld } end # Get TLD information. # @see https://api.gandi.net/docs/domains#get-v5-domain-tlds-name # @param name [String, #to_s] the top level domain to get information for. # @return [GandiV5::Domain::TLD] # @raise [GandiV5::Error::GandiError] if Gandi returns an error. def self.fetch(name) _response, data = GandiV5.get url(name) GandiV5::Domain::TLD.from_gandi data end private def self.url(name = nil) "#{BASE}domain/tlds" + (name ? "/#{CGI.escape name}" : '') end private_class_method :url end |
Class Method Details
.fetch(name) ⇒ GandiV5::Domain::TLD
Get TLD information.
43 44 45 46 |
# File 'lib/gandi_v5/domain/tld.rb', line 43 def self.fetch(name) _response, data = GandiV5.get url(name) GandiV5::Domain::TLD.from_gandi data end |
.list ⇒ Object
List of available TLDs.
32 33 34 35 36 |
# File 'lib/gandi_v5/domain/tld.rb', line 32 def self.list GandiV5.get(url) .last .map { |tld| GandiV5::Domain::TLD.from_gandi tld } end |