Class: WsCee::Client

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

Constant Summary collapse

WS_CEE_TESTING_URL =
'https://source.bisnode.cz/services/cee_fix/v001/soap?wsdl'
WS_CEE_PRODUCTION_URL =
'https://source.bisnode.cz/services/cee/v001/soap?wsdl'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/ws_cee_client.rb', line 20

def initialize(options={})
  @username = options[:username]
  @password = options[:password]
  @proxy = options[:proxy].to_s

  savon_options = { wsdl: (options[:testing] ? WS_CEE_TESTING_URL : WS_CEE_PRODUCTION_URL) }
  savon_options.merge!({ proxy: @proxy }) if !@proxy.nil? && !@proxy.empty?

  @savon = Savon.client savon_options
rescue *SAVON_ERRORS => e
  raise WsCee::ConnectionError, e.message
end

Instance Attribute Details

#passwordObject (readonly)

Returns the value of attribute password.



16
17
18
# File 'lib/ws_cee_client.rb', line 16

def password
  @password
end

#proxyObject (readonly)

Returns the value of attribute proxy.



17
18
19
# File 'lib/ws_cee_client.rb', line 17

def proxy
  @proxy
end

#savonObject (readonly)

Returns the value of attribute savon.



18
19
20
# File 'lib/ws_cee_client.rb', line 18

def savon
  @savon
end

#usernameObject (readonly)

Returns the value of attribute username.



15
16
17
# File 'lib/ws_cee_client.rb', line 15

def username
  @username
end

Instance Method Details

#cause_detail(options) ⇒ Object



41
42
43
# File 'lib/ws_cee_client.rb', line 41

def cause_detail(options)
  detail options[:cause_code]
end

#find_by_company(company_details) ⇒ Object



33
34
35
# File 'lib/ws_cee_client.rb', line 33

def find_by_company(company_details)
  company_indication company_details
end

#find_by_person(person_details) ⇒ Object



37
38
39
# File 'lib/ws_cee_client.rb', line 37

def find_by_person(person_details)
  person_indication person_details
end