Class: GandiV5::Domain::TLD

Inherits:
Object
  • Object
show all
Includes:
GandiV5::Data
Defined in:
lib/gandi_v5/domain/tld.rb

Overview

Information about a specific TLD (Top Level Domain).

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from GandiV5::Data

#from_gandi, included, #initialize, #to_gandi, #to_h, #values_at

Instance Attribute Details

#authinfo_for_transferBoolean (readonly)

Returns whether authinfo is required for a transfer.

Returns:

  • (Boolean)

    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

#categoryString (readonly)

Returns:

  • (String)


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_ownerBoolean (readonly)

Returns whther changing owner is pemritted.

Returns:

  • (Boolean)

    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

#corporateBoolean (readonly)

Returns whether this is a corporate TLD.

Returns:

  • (Boolean)

    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_tradeBoolean (readonly)

Returns:

  • (Boolean)


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_tldString (readonly)

Returns:

  • (String)


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

#lockBoolean (readonly)

Returns:

  • (Boolean)


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

#nameString (readonly)

Returns:

  • (String)


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.

Parameters:

  • name (String, #to_s)

    the top level domain to get information for.

Returns:

Raises:

See Also:



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

.listObject

List of available TLDs.

Raises:

See Also:



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