Class: Softlayer::Client

Inherits:
Savon::Client
  • Object
show all
Defined in:
lib/softlayer/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(service) ⇒ Client

Returns a new instance of Client.



4
5
6
7
# File 'lib/softlayer/client.rb', line 4

def initialize(service)
  @service = service
  super client_params
end

Instance Method Details

#call(method, message = {}, hash = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/softlayer/client.rb', line 9

def call(method, message = {}, hash = nil)
  safe do
    if hash.nil?
      resp = super method, message: message
    else
      resp = super method, message: message, soap_header: hash
    end
    resp.to_hash["#{method}_response".to_sym]["#{method}_return".to_sym]
  end
end