Class: Zuora::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/zuora/client.rb

Constant Summary collapse

INSTANCE_VARIABLE_LOG_BLACKLIST =
%i[@username @password].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username, password, sandbox = true) ⇒ Client

Returns a new instance of Client.



13
14
15
16
17
# File 'lib/zuora/client.rb', line 13

def initialize(username, password, sandbox = true)
  @username = username
  @password = password
  @sandbox = sandbox
end

Instance Attribute Details

#session_tokenObject

Returns the value of attribute session_token.



9
10
11
# File 'lib/zuora/client.rb', line 9

def session_token
  @session_token
end

Instance Method Details

#call!(*args) ⇒ Object

Delegate SOAP methods to SOAP client



20
21
22
# File 'lib/zuora/client.rb', line 20

def call!(*args)
  soap_client.call!(*args)
end

#to_sObject Also known as: inspect

Like Object.to_s, except excludes BLACKLISTed instance vars



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/zuora/client.rb', line 32

def to_s
  public_vars = instance_variables.reject do |var|
    INSTANCE_VARIABLE_LOG_BLACKLIST.include? var
  end

  public_vars.map! do |var|
    "#{var}=\"#{instance_variable_get(var)}\""
  end

  public_vars = public_vars.join(' ')

  "<##{self.class}:#{object_id.to_s(8)} #{public_vars}>"
end