Class: Gandi::Session
- Inherits:
-
Object
- Object
- Gandi::Session
- Defined in:
- lib/gandi/session.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
Instance Method Summary collapse
-
#initialize(api_key, options = {}) ⇒ Session
constructor
A new instance of Session.
- #list_methods ⇒ Object
- #method_help(name) ⇒ Object
- #method_missing(method, *args) ⇒ Object
- #method_signature(name) ⇒ Object
Constructor Details
#initialize(api_key, options = {}) ⇒ Session
Returns a new instance of Session.
206 207 208 209 210 211 212 213 214 |
# File 'lib/gandi/session.rb', line 206 def initialize(api_key, = {}) endpoint = .is_a?(Hash) ? (ENDPOINT[[:env]] || ENDPOINT[:production]) : @api_key = api_key @server = XMLRPC::Client.new2(endpoint) # fix a bug in ruby 2.0, http://bugs.ruby-lang.org/issues/8182 @server.http_header_extra = { "accept-encoding" => "identity" } @server end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
204 205 206 |
# File 'lib/gandi/session.rb', line 204 def api_key @api_key end |
Instance Method Details
#list_methods ⇒ Object
216 217 218 |
# File 'lib/gandi/session.rb', line 216 def list_methods server.call('system.listMethods') end |
#method_help(name) ⇒ Object
224 225 226 |
# File 'lib/gandi/session.rb', line 224 def method_help(name) server.call('system.methodHelp', name) end |
#method_signature(name) ⇒ Object
220 221 222 |
# File 'lib/gandi/session.rb', line 220 def method_signature(name) server.call('system.methodSignature', name) end |