Class: Gandi::Connection
- Inherits:
-
Object
- Object
- Gandi::Connection
- Defined in:
- lib/gandi/connection.rb
Constant Summary collapse
- SSL_VERIFY_MODE =
OpenSSL::SSL::VERIFY_NONE
Instance Attribute Summary collapse
-
#apikey ⇒ Object
readonly
The 24-character API key used for authentication.
-
#url ⇒ Object
readonly
URL used for connecting to the Gandi API.
Instance Method Summary collapse
-
#call(method, *arguments) ⇒ Object
Calls a RPC method, automatically setting the apikey as the first argument.
-
#initialize(apikey, url) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(apikey, url) ⇒ Connection
Returns a new instance of Connection.
19 20 21 22 23 24 |
# File 'lib/gandi/connection.rb', line 19 def initialize(apikey, url) raise DataError, "You must set the apikey before calling any method" unless apikey @apikey = apikey @url = url connect end |
Instance Attribute Details
#apikey ⇒ Object (readonly)
The 24-character API key used for authentication.
14 15 16 |
# File 'lib/gandi/connection.rb', line 14 def apikey @apikey end |
#url ⇒ Object (readonly)
URL used for connecting to the Gandi API.
17 18 19 |
# File 'lib/gandi/connection.rb', line 17 def url @url end |
Instance Method Details
#call(method, *arguments) ⇒ Object
Calls a RPC method, automatically setting the apikey as the first argument.
27 28 29 |
# File 'lib/gandi/connection.rb', line 27 def call(method, *arguments) raw_call(method.to_s, @apikey, *arguments) end |