deltavista_crif_dva_interface 0.0.19 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,7 @@ module DeltavistaCrifDvaInterface
25
25
  @config = {}
26
26
  if options.is_a? Hash
27
27
  @config = DEFAULT_OPTIONS.merge(options)
28
- @logger = options[:logger] || Logger.new(STDOUT)
28
+ @logger = options[:logger] ? options[:logger] : Logger.new(STDOUT)
29
29
  else
30
30
  @config[:username] = options.username
31
31
  @config[:password] = options.password
@@ -8,11 +8,43 @@ module DeltavistaCrifDvaInterface
8
8
  @config = config
9
9
  end
10
10
 
11
+ # @param language [String] language of legal form, default de
12
+ # @return [Array] all available legal forms for deltavista check
13
+ def self.legal_forms(language = 'de')
14
+ if language == 'de'
15
+ [
16
+ ['AG', 2],
17
+ ['GmbH', 3],
18
+ ['Genossenschaft', 4],
19
+ ['Kommanditgesellschaft', 5],
20
+ ['Kollektivgesellschaft', 6],
21
+ ['Einzelfirma', 7],
22
+ ['Verein', 8],
23
+ ['Einfache Gesellschaft', 9],
24
+ ['Andere', 99]
25
+ ]
26
+ end
27
+ end
28
+
29
+ # @param language [String] language of gender, default de
30
+ # @return [Array] all available genders for deltavista check
31
+ def self.genders(language = 'de')
32
+ if language == 'de'
33
+ [
34
+ ['Unbekannt', 0],
35
+ ['Männlich', 1],
36
+ ['Weiblich', 2]
37
+ ]
38
+ end
39
+ end
40
+
11
41
  # Takes an address object and sends it as XML to the DeltaVista-Interface.
12
42
  # The XML-Response will be converted back into an address object and returned.
13
43
  # If no address is available the method returns nil.
14
44
  #
15
45
  # If the Service is not available a StandardError will be thrown.
46
+ # @param address [Struct] collection of the address to verify
47
+ # @return [Struct] address Record and score decision
16
48
  def credit_check(address)
17
49
  @parser = CreditCheckShortV02.new @config
18
50
  request_body = @parser.to_xml(address)
@@ -22,6 +54,14 @@ module DeltavistaCrifDvaInterface
22
54
  end
23
55
  end
24
56
 
57
+ # Takes an address object and sends it as XML to the DeltaVista-Interface.
58
+ # The XML-Response will be converted back into an address object and returned.
59
+ # If no address is available the method returns nil.
60
+ #
61
+ # If the Service is not available a StandardError will be thrown.
62
+ #
63
+ # @param address [Struct] collection of the address to scan
64
+ # @return [Struct] address Record
25
65
  def verify_address(address)
26
66
  @parser = AddressUpdate.new @config
27
67
  request_body = @parser.to_xml(address)
@@ -31,6 +71,8 @@ module DeltavistaCrifDvaInterface
31
71
  end
32
72
  end
33
73
 
74
+ # @param xml_body [String] XML Body to parse
75
+ # @return [Struct] XML Body converted to hash
34
76
  def extract_response(xml_body)
35
77
  @parser.to_hash(xml_body)
36
78
  end
@@ -1,3 +1,3 @@
1
1
  module DeltavistaCrifDvaInterface
2
- VERSION = '0.0.19'
2
+ VERSION = '0.0.20'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deltavista_crif_dva_interface
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.19
4
+ version: 0.0.20
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: