Module: Gandi

Defined in:
lib/gandi.rb,
lib/gandi/domain.rb,
lib/gandi/errors.rb,
lib/gandi/contact.rb,
lib/gandi/version.rb,
lib/gandi/connector.rb,
lib/gandi/operation.rb,
lib/gandi/connection.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,
lib/gandi/gandi_object_methods.rb

Defined Under Namespace

Modules: Connector, GandiObjectMethods Classes: Connection, Contact, DataError, Domain, NoMethodError, Operation, ServerError

Constant Summary collapse

URL =

Production URL

"https://rpc.gandi.net/xmlrpc/"
TEST_URL =

OT&E URL

"https://rpc.ote.gandi.net/xmlrpc/"
VERSION =
"2.1.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.apikeyObject

The 24-character API key used for authentication.



19
20
21
# File 'lib/gandi.rb', line 19

def apikey
  @apikey
end

.connectionObject

A Gandi::Connection object set using the provided apikey and url. This object can be overriden for testing purposes. Note that the connection object is reset if the apikey or url is changed.



43
44
45
# File 'lib/gandi.rb', line 43

def connection
  @connection ||= Gandi::Connection.new(apikey, url)
end

Class Method Details

.api_versionObject

Returns the API version from Gandi.



55
56
57
# File 'lib/gandi.rb', line 55

def api_version
  Gandi.call('version.info')['api_version']
end

.call(method, *arguments) ⇒ Object

Calls a Gandi XML-RPC method, transparently providing the apikey.



50
51
52
# File 'lib/gandi.rb', line 50

def call(method, *arguments)
  connection.call(method, *arguments)
end

.urlObject

The URL for the Gandi connection.



29
30
31
# File 'lib/gandi.rb', line 29

def url
  @url || Gandi::TEST_URL
end

.url=(url) ⇒ Object

Sets the URL for the Gandi connection. Changing it will reset the connection.



35
36
37
38
# File 'lib/gandi.rb', line 35

def url=(url)
  @url = url
  @connection = nil
end