Class: Gandi::Domain
- Inherits:
-
Object
- Object
- Gandi::Domain
- Extended by:
- Transferin
- Includes:
- Contacts, Nameservers, Status, GandiObjectMethods
- Defined in:
- lib/gandi/domain.rb,
lib/gandi/domain/tld.rb,
lib/gandi/domain/host.rb,
lib/gandi/domain/zone.rb,
lib/gandi/domain/status.rb,
lib/gandi/domain/forward.rb,
lib/gandi/domain/mailbox.rb,
lib/gandi/domain/contacts.rb,
lib/gandi/domain/transferin.rb,
lib/gandi/domain/nameservers.rb,
lib/gandi/domain/zone/record.rb,
lib/gandi/domain/zone/version.rb
Defined Under Namespace
Modules: Contacts, Nameservers, Status, Transferin Classes: Forward, Host, Mailbox, Tld, Zone
Instance Attribute Summary collapse
-
#fqdn ⇒ Object
readonly
Returns the value of attribute fqdn.
Class Method Summary collapse
-
.available(fqdns) ⇒ Object
Check the availability of some domain names.
-
.count(filters = {}) ⇒ Object
Count domains visible by this account.
-
.create(fqdn, params) ⇒ Object
Create a domain with the given information.
-
.list(opts = {}) ⇒ Object
List operations done by this account.
Instance Method Summary collapse
-
#info ⇒ Object
get domain information.
-
#initialize(fqdn) ⇒ Domain
constructor
A new instance of Domain.
-
#renew(params) ⇒ Object
Renew a domain.
Methods included from Transferin
Methods included from Nameservers
Methods included from Status
Methods included from Contacts
Methods included from GandiObjectMethods
#[], included, #inspect, #to_hash
Constructor Details
#initialize(fqdn) ⇒ Domain
Returns a new instance of Domain.
23 24 25 26 |
# File 'lib/gandi/domain.rb', line 23 def initialize(fqdn) @fqdn = fqdn @attributes = info end |
Instance Attribute Details
#fqdn ⇒ Object (readonly)
Returns the value of attribute fqdn.
21 22 23 |
# File 'lib/gandi/domain.rb', line 21 def fqdn @fqdn end |
Class Method Details
.available(fqdns) ⇒ Object
Check the availability of some domain names.
41 42 43 |
# File 'lib/gandi/domain.rb', line 41 def available(fqdns) call('domain.available', fqdns) end |
.count(filters = {}) ⇒ Object
Count domains visible by this account.
46 47 48 |
# File 'lib/gandi/domain.rb', line 46 def count(filters = {}) call('domain.count', filters) end |
.create(fqdn, params) ⇒ Object
Create a domain with the given information. Returns a Gandi::Operation object.
61 62 63 64 |
# File 'lib/gandi/domain.rb', line 61 def create(fqdn, params) operation_hash = call('domain.create', fqdn, params) Gandi::Operation.new(operation_hash['id'], operation_hash) end |
.list(opts = {}) ⇒ Object
List operations done by this account. Note that domain.info will be called for each domain (as the info hash returned by domain.list is missing some informations). This may result in a lot of API calls if you have many registered domains for your contact, so using opts to restrict results is advised (or use a raw API call).
53 54 55 56 57 |
# File 'lib/gandi/domain.rb', line 53 def list(opts = {}) call('domain.list', opts).map do |domain| self.new(domain['fqdn']) end end |
Instance Method Details
#info ⇒ Object
get domain information.
29 30 31 |
# File 'lib/gandi/domain.rb', line 29 def info self.class.call('domain.info', @fqdn) end |