hithorizons 0.5 → 0.6
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/changelog.md +3 -0
- data/lib/hithorizons/countries.rb +57 -57
- data/lib/hithorizons/country.rb +15 -15
- data/lib/hithorizons/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd4123e7f39897f826b6a63299c3d109098b61d9de82e882a7f8b890671d03c4
|
4
|
+
data.tar.gz: bf965383e5a05c52efe9c245fd05a0f4bc52d70acda91cac4cee6cf477c12d35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10b4a5c2dbb55827d3ab241c99a53e449e582bb25ac18db9f9bc0def008d2356a00808f6cde722cd3a09ad9727d7d7670708612657feaca0bc0c3463a28435b5
|
7
|
+
data.tar.gz: c8486701a31bbb462ec8ccb294f8fedf4c16591aeb2bcbb0d9d24f04c133ec52b5993df8f2f0288a0f2b3c5939ba2a3a786dbede82a9013b5344e3a1f4f53a69
|
data/Gemfile.lock
CHANGED
data/changelog.md
CHANGED
@@ -3,63 +3,63 @@
|
|
3
3
|
module Hithorizons
|
4
4
|
class Countries
|
5
5
|
LIST = [
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
].
|
6
|
+
Country.new('ALB', 'ALBANIA', registration_number: true),
|
7
|
+
Country.new('AND', 'ANDORRA', registration_number: true),
|
8
|
+
Country.new('ARM', 'ARMENIA', registration_number: true),
|
9
|
+
Country.new('AUS', 'AUSTRIA', vat_id: true),
|
10
|
+
Country.new('AZE', 'AZERBAIJAN', registration_number: true),
|
11
|
+
Country.new('BLR', 'BELARUS', registration_number: true),
|
12
|
+
Country.new('BEL', 'BELGIUM', registration_number: true),
|
13
|
+
Country.new('BIH', 'BOSNIA AND HERZEGOVINA', registration_number: true),
|
14
|
+
Country.new('BGR', 'BULGARIA', registration_number: true),
|
15
|
+
Country.new('HRV', 'CROATIA', registration_number: true),
|
16
|
+
Country.new('CYP', 'CYPRUS', vat_id: true),
|
17
|
+
Country.new('CZE', 'CZECH REPUBLIC', registration_number: true),
|
18
|
+
Country.new('DNK', 'DENMARK', registration_number: true),
|
19
|
+
Country.new('GBR', 'ENGLAND', vat_id: true),
|
20
|
+
Country.new('EST', 'ESTONIA', vat_id: true),
|
21
|
+
Country.new('FRO', 'FAROE ISLANDS', registration_number: true),
|
22
|
+
Country.new('FIN', 'FINLAND', registration_number: true),
|
23
|
+
Country.new('FRA', 'FRANCE', vat_id: true),
|
24
|
+
Country.new('GEO', 'GEORGIA', registration_number: true),
|
25
|
+
Country.new('DEU', 'GERMANY', vat_id: true),
|
26
|
+
Country.new('GIB', 'GIBRALTAR', registration_number: true),
|
27
|
+
Country.new('GRC', 'GREECE', registration_number: true),
|
28
|
+
Country.new('GRL', 'GREENLAND', registration_number: true),
|
29
|
+
Country.new('HUN', 'HUNGARY', tax_id: true),
|
30
|
+
Country.new('ISL', 'ICELAND', registration_number: true),
|
31
|
+
Country.new('ITA', 'ITALY', registration_number: true),
|
32
|
+
Country.new('KAZ', 'KAZAKHSTAN', registration_number: true),
|
33
|
+
Country.new('XKX', 'KOSOVO', registration_number: true),
|
34
|
+
Country.new('KGZ', 'KYRGYZSTAN', registration_number: true),
|
35
|
+
Country.new('LVA', 'LATVIA', vat_id: true),
|
36
|
+
Country.new('LIE', 'LIECHTENSTEIN', vat_id: true),
|
37
|
+
Country.new('LTU', 'LITHUANIA', registration_number: true),
|
38
|
+
Country.new('LUX', 'LUXEMBOURG', vat_id: true),
|
39
|
+
Country.new('MKD', 'MACEDONIA', registration_number: true),
|
40
|
+
Country.new('MLT', 'MALTA', vat_id: true),
|
41
|
+
Country.new('MDA', 'MOLDOVA', registration_number: true),
|
42
|
+
Country.new('MCO', 'MONACO', registration_number: true),
|
43
|
+
Country.new('MNE', 'MONTENEGRO', registration_number: true),
|
44
|
+
Country.new('NLD', 'NETHERLANDS', vat_id: true),
|
45
|
+
Country.new('NOR', 'NORWAY', registration_number: true),
|
46
|
+
Country.new('POL', 'POLAND', registration_number: true),
|
47
|
+
Country.new('PRT', 'PORTUGAL', registration_number: true),
|
48
|
+
Country.new('ROU', 'ROMANIA', tax_id: true),
|
49
|
+
Country.new('RUS', 'RUSSIAN FEDERATION', registration_number: true),
|
50
|
+
Country.new('SMR', 'SAN MARINO', registration_number: true),
|
51
|
+
Country.new('SRB', 'SERBIA', registration_number: true),
|
52
|
+
Country.new('SVK', 'SLOVAKIA', registration_number: true),
|
53
|
+
Country.new('SVN', 'SLOVENIA', vat_id: true),
|
54
|
+
Country.new('ESP', 'SPAIN', registration_number: true),
|
55
|
+
Country.new('SWE', 'SWEDEN', vat_id: true),
|
56
|
+
Country.new('CHE', 'SWITZERLAND', registration_number: true),
|
57
|
+
Country.new('TJK', 'TAJIKISTAN', registration_number: true),
|
58
|
+
Country.new('TUR', 'TURKEY', registration_number: true),
|
59
|
+
Country.new('TKM', 'TURKMENISTAN', registration_number: true),
|
60
|
+
Country.new('UKR', 'UKRAINE', registration_number: true),
|
61
|
+
Country.new('UZB', 'UZBEKISTAN', registration_number: true),
|
62
|
+
].freeze
|
63
63
|
|
64
64
|
def self.find_by_iso3(iso3)
|
65
65
|
LIST.find { |country| country.iso3 == iso3 }
|
data/lib/hithorizons/country.rb
CHANGED
@@ -4,14 +4,20 @@ module Hithorizons
|
|
4
4
|
class Country
|
5
5
|
attr_reader :iso3, :name
|
6
6
|
|
7
|
-
def initialize(iso3, name, registration_number)
|
7
|
+
def initialize(iso3, name, registration_number: false, tax_id: false, vat_id: false)
|
8
8
|
@iso3 = iso3
|
9
9
|
@name = name
|
10
10
|
@registration_number = registration_number
|
11
|
+
@tax_id = tax_id
|
12
|
+
@vat_id = vat_id
|
11
13
|
end
|
12
14
|
|
13
15
|
def vat_id?
|
14
|
-
|
16
|
+
@vat_id
|
17
|
+
end
|
18
|
+
|
19
|
+
def tax_id?
|
20
|
+
@tax_id
|
15
21
|
end
|
16
22
|
|
17
23
|
def registration_number?
|
@@ -21,25 +27,19 @@ module Hithorizons
|
|
21
27
|
def vat_id(company)
|
22
28
|
return unless vat_id?
|
23
29
|
|
24
|
-
|
25
|
-
when 'HUN'
|
26
|
-
"HU#{company['NationalId'][0...-3]}"
|
27
|
-
when 'ROU'
|
28
|
-
"RO#{company['NationalId']}"
|
29
|
-
else
|
30
|
-
company['NationalId']
|
31
|
-
end
|
30
|
+
company['NationalId']
|
32
31
|
end
|
33
32
|
|
34
33
|
def tax_id(company)
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
34
|
+
return unless tax_id?
|
35
|
+
|
36
|
+
company['NationalId']
|
39
37
|
end
|
40
38
|
|
41
39
|
def registration_number(company)
|
42
|
-
|
40
|
+
return unless registration_number?
|
41
|
+
|
42
|
+
company['NationalId']
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
data/lib/hithorizons/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hithorizons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.6'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lubomir Vnenk
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|