Module: Gandi::Domain::Contacts

Included in:
Gandi::Domain
Defined in:
lib/gandi/domain/contacts.rb

Instance Method Summary collapse

Instance Method Details

#contactsObject

Returns an hash of contacts, keys being the type of contact and values Gandi::Contact objects. TODO make the contact mapping optional.



6
7
8
# File 'lib/gandi/domain/contacts.rb', line 6

def contacts
  @attributes['contacts'].inject({}) { |h, contact| h[contact.first] = Gandi::Contact.new(contact.last['handle']); h }
end

#contacts=(contacts) ⇒ Object

Change domain’s contact. Uses the API call domain.contacts.set Returns a Gandi::Operation object. NOTE: you cannot change the owner or reseller contacts. FIXME: is it possible to return the operation object and not the contacts hash passed as a param? TODO accept Gandi::Contact objects as values for the hash.



15
16
17
18
# File 'lib/gandi/domain/contacts.rb', line 15

def contacts=(contacts)
  operation_hash = self.class.call('domain.contacts.set', @fqdn, contacts)
  Gandi::Operation.new(operation_hash['id'], operation_hash)
end