Method: EPC::Client::BaseClient#initialize

Defined in:
lib/epc/client/base_client.rb

#initialize(target_url = EPC::Config::DEFAULT_TARGET, caller_id = nil, auth_token = nil, debug = false) ⇒ BaseClient

Returns a new instance of BaseClient.



12
13
14
15
16
17
18
19
20
21
# File 'lib/epc/client/base_client.rb', line 12

def initialize(target_url=EPC::Config::DEFAULT_TARGET, caller_id = nil, auth_token = nil, debug = false)
  target_url = "http://#{target_url}" unless target_url =~ /^https?/
  target_url = target_url.gsub(/\/+$/, '')
  @target =  target_url

  @caller_id = caller_id || EPC::Config.caller_id
  @auth_token = auth_token || EPC::Config.auth_token
  @digest = OpenSSL::Digest::Digest.new('sha256')
  @debug = debug
end