countries 6.0.0 → 6.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/countries/cache/countries.json +1 -1
- data/lib/countries/country/conversion_methods.rb +17 -0
- data/lib/countries/country.rb +1 -0
- data/lib/countries/data/countries/BG.yaml +1 -0
- data/lib/countries/data/countries/EE.yaml +1 -1
- data/lib/countries/data/countries/NL.yaml +1 -0
- data/lib/countries/data/subdivisions/GT.yaml +44 -44
- data/lib/countries/iso3166.rb +1 -0
- data/lib/countries/version.rb +1 -1
- metadata +4 -3
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ISO3166
|
4
|
+
module ConversionMethods
|
5
|
+
# @param alpha2 [String] ISO 3166 alpha-2 country code.
|
6
|
+
# @return [String] ISO 3166 alpha-3 country code.
|
7
|
+
def from_alpha2_to_alpha3(alpha2)
|
8
|
+
find_country_by_alpha2(alpha2)&.alpha3
|
9
|
+
end
|
10
|
+
|
11
|
+
# @param alpha3 [String] ISO 3166 alpha-3 country code.
|
12
|
+
# @return [String] ISO 3166 alpha-2 country code.
|
13
|
+
def from_alpha3_to_alpha2(alpha3)
|
14
|
+
find_country_by_alpha3(alpha3)&.alpha2
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/countries/country.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
2
|
+
'16':
|
3
3
|
name: Alta Verapaz
|
4
|
-
code:
|
4
|
+
code: '16'
|
5
5
|
unofficial_names: Alta Verapaz
|
6
6
|
geo:
|
7
7
|
latitude: 15.5942883
|
@@ -61,9 +61,9 @@ AV:
|
|
61
61
|
'no': Alta Verapaz
|
62
62
|
comments:
|
63
63
|
type: department
|
64
|
-
|
64
|
+
'15':
|
65
65
|
name: Baja Verapaz
|
66
|
-
code:
|
66
|
+
code: '15'
|
67
67
|
unofficial_names: Baja Verapaz
|
68
68
|
geo:
|
69
69
|
latitude: 15.0787498
|
@@ -122,9 +122,9 @@ BV:
|
|
122
122
|
'no': Baja Verapaz
|
123
123
|
comments:
|
124
124
|
type: department
|
125
|
-
|
125
|
+
'04':
|
126
126
|
name: Chimaltenango
|
127
|
-
code:
|
127
|
+
code: '04'
|
128
128
|
unofficial_names: Chimaltenango
|
129
129
|
geo:
|
130
130
|
latitude: 14.662222
|
@@ -183,9 +183,9 @@ CM:
|
|
183
183
|
'no': Chimaltenango
|
184
184
|
comments:
|
185
185
|
type: department
|
186
|
-
|
186
|
+
'20':
|
187
187
|
name: Chiquimula
|
188
|
-
code:
|
188
|
+
code: '20'
|
189
189
|
unofficial_names: Chiquimula
|
190
190
|
geo:
|
191
191
|
latitude: 14.783333
|
@@ -242,9 +242,9 @@ CQ:
|
|
242
242
|
'no': Chiquimula
|
243
243
|
comments:
|
244
244
|
type: department
|
245
|
-
|
245
|
+
'05':
|
246
246
|
name: Escuintla
|
247
|
-
code:
|
247
|
+
code: '05'
|
248
248
|
unofficial_names: Escuintla
|
249
249
|
geo:
|
250
250
|
latitude: 14.3009389
|
@@ -302,9 +302,9 @@ ES:
|
|
302
302
|
'no': Escuintla
|
303
303
|
comments:
|
304
304
|
type: department
|
305
|
-
|
305
|
+
'01':
|
306
306
|
name: Guatemala
|
307
|
-
code:
|
307
|
+
code: '01'
|
308
308
|
unofficial_names: Guatemala
|
309
309
|
geo:
|
310
310
|
latitude: 14.613333
|
@@ -365,9 +365,9 @@ GU:
|
|
365
365
|
'no': Guatemala
|
366
366
|
comments:
|
367
367
|
type: department
|
368
|
-
|
368
|
+
'13':
|
369
369
|
name: Huehuetenango
|
370
|
-
code:
|
370
|
+
code: '13'
|
371
371
|
unofficial_names: Huehuetenango
|
372
372
|
geo:
|
373
373
|
latitude: 15.314722
|
@@ -425,9 +425,9 @@ HU:
|
|
425
425
|
'no': Huehuetenango
|
426
426
|
comments:
|
427
427
|
type: department
|
428
|
-
|
428
|
+
'18':
|
429
429
|
name: Izabal
|
430
|
-
code:
|
430
|
+
code: '18'
|
431
431
|
unofficial_names: Izabal
|
432
432
|
geo:
|
433
433
|
latitude: 15.4036847
|
@@ -485,9 +485,9 @@ IZ:
|
|
485
485
|
'no': Izabal
|
486
486
|
comments:
|
487
487
|
type: department
|
488
|
-
|
488
|
+
'21':
|
489
489
|
name: Jalapa
|
490
|
-
code:
|
490
|
+
code: '21'
|
491
491
|
unofficial_names: Jalapa
|
492
492
|
geo:
|
493
493
|
latitude: 14.5655154
|
@@ -545,9 +545,9 @@ JA:
|
|
545
545
|
'no': Jalapa
|
546
546
|
comments:
|
547
547
|
type: department
|
548
|
-
|
548
|
+
'22':
|
549
549
|
name: Jutiapa
|
550
|
-
code:
|
550
|
+
code: '22'
|
551
551
|
unofficial_names: Jutiapa
|
552
552
|
geo:
|
553
553
|
latitude: 14.282778
|
@@ -606,9 +606,9 @@ JU:
|
|
606
606
|
'no': Jutiapa
|
607
607
|
comments:
|
608
608
|
type: department
|
609
|
-
|
609
|
+
'17':
|
610
610
|
name: Petén
|
611
|
-
code:
|
611
|
+
code: '17'
|
612
612
|
unofficial_names: Petén
|
613
613
|
geo:
|
614
614
|
latitude: 16.912033
|
@@ -668,9 +668,9 @@ PE:
|
|
668
668
|
'no': Petén
|
669
669
|
comments:
|
670
670
|
type: department
|
671
|
-
|
671
|
+
'02':
|
672
672
|
name: El Progreso
|
673
|
-
code:
|
673
|
+
code: '02'
|
674
674
|
unofficial_names: El Progreso
|
675
675
|
geo:
|
676
676
|
latitude: 14.86527
|
@@ -728,9 +728,9 @@ PR:
|
|
728
728
|
'no': El Progreso
|
729
729
|
comments:
|
730
730
|
type: department
|
731
|
-
|
731
|
+
'14':
|
732
732
|
name: Quiché
|
733
|
-
code:
|
733
|
+
code: '14'
|
734
734
|
unofficial_names: Quiché
|
735
735
|
geo:
|
736
736
|
latitude: 15.4983808
|
@@ -788,9 +788,9 @@ QC:
|
|
788
788
|
'no': Quiché
|
789
789
|
comments:
|
790
790
|
type: department
|
791
|
-
|
791
|
+
'09':
|
792
792
|
name: Quetzaltenango
|
793
|
-
code:
|
793
|
+
code: '09'
|
794
794
|
unofficial_names:
|
795
795
|
- Quetzaltenango
|
796
796
|
geo:
|
@@ -851,9 +851,9 @@ QZ:
|
|
851
851
|
'no': Quetzaltenango
|
852
852
|
comments:
|
853
853
|
type: department
|
854
|
-
|
854
|
+
'11':
|
855
855
|
name: Retalhuleu
|
856
|
-
code:
|
856
|
+
code: '11'
|
857
857
|
unofficial_names: Retalhuleu
|
858
858
|
geo:
|
859
859
|
latitude: 14.533333
|
@@ -912,9 +912,9 @@ RE:
|
|
912
912
|
'no': Retalhuleu
|
913
913
|
comments:
|
914
914
|
type: department
|
915
|
-
|
915
|
+
'03':
|
916
916
|
name: Sacatepéquez
|
917
|
-
code:
|
917
|
+
code: '03'
|
918
918
|
unofficial_names: Sacatepéquez
|
919
919
|
geo:
|
920
920
|
latitude: 14.6110576
|
@@ -974,9 +974,9 @@ SA:
|
|
974
974
|
'no': Sacatepéquez
|
975
975
|
comments:
|
976
976
|
type: department
|
977
|
-
|
977
|
+
'12':
|
978
978
|
name: San Marcos
|
979
|
-
code:
|
979
|
+
code: '12'
|
980
980
|
unofficial_names: San Marcos
|
981
981
|
geo:
|
982
982
|
latitude: 14.9309569
|
@@ -1034,9 +1034,9 @@ SM:
|
|
1034
1034
|
'no': San Marcos (departement)
|
1035
1035
|
comments:
|
1036
1036
|
type: department
|
1037
|
-
|
1037
|
+
'07':
|
1038
1038
|
name: Sololá
|
1039
|
-
code:
|
1039
|
+
code: '07'
|
1040
1040
|
unofficial_names: Sololá
|
1041
1041
|
geo:
|
1042
1042
|
latitude: 14.773889
|
@@ -1094,9 +1094,9 @@ SO:
|
|
1094
1094
|
'no': Sololá
|
1095
1095
|
comments:
|
1096
1096
|
type: department
|
1097
|
-
|
1097
|
+
'06':
|
1098
1098
|
name: Santa Rosa
|
1099
|
-
code:
|
1099
|
+
code: '06'
|
1100
1100
|
unofficial_names: Santa Rosa
|
1101
1101
|
geo:
|
1102
1102
|
latitude: 14.1928003
|
@@ -1156,9 +1156,9 @@ SR:
|
|
1156
1156
|
'no': Santa Rosa (departement)
|
1157
1157
|
comments:
|
1158
1158
|
type: department
|
1159
|
-
|
1159
|
+
'10':
|
1160
1160
|
name: Suchitepéquez
|
1161
|
-
code:
|
1161
|
+
code: '10'
|
1162
1162
|
unofficial_names: Suchitepéquez
|
1163
1163
|
geo:
|
1164
1164
|
latitude: 14.4215982
|
@@ -1216,9 +1216,9 @@ SU:
|
|
1216
1216
|
'no': Suchitepéquez
|
1217
1217
|
comments:
|
1218
1218
|
type: department
|
1219
|
-
|
1219
|
+
'08':
|
1220
1220
|
name: Totonicapán
|
1221
|
-
code:
|
1221
|
+
code: '08'
|
1222
1222
|
unofficial_names: Totonicapán
|
1223
1223
|
geo:
|
1224
1224
|
latitude: 14.910833
|
@@ -1276,9 +1276,9 @@ TO:
|
|
1276
1276
|
'no': Totonicapán (departement)
|
1277
1277
|
comments:
|
1278
1278
|
type: department
|
1279
|
-
|
1279
|
+
'19':
|
1280
1280
|
name: Zacapa
|
1281
|
-
code:
|
1281
|
+
code: '19'
|
1282
1282
|
unofficial_names: Zacapa
|
1283
1283
|
geo:
|
1284
1284
|
latitude: 15.0784265
|
data/lib/countries/iso3166.rb
CHANGED
@@ -11,6 +11,7 @@ require 'countries/structure'
|
|
11
11
|
require 'countries/translations'
|
12
12
|
require 'countries/country/country_subdivision_methods'
|
13
13
|
require 'countries/country/class_methods'
|
14
|
+
require 'countries/country/conversion_methods'
|
14
15
|
require 'countries/country/finder_methods'
|
15
16
|
require 'countries/country/emoji'
|
16
17
|
require 'countries/country'
|
data/lib/countries/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: countries
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Robinson
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2024-
|
14
|
+
date: 2024-05-18 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: unaccent
|
@@ -229,6 +229,7 @@ files:
|
|
229
229
|
- lib/countries/configuration.rb
|
230
230
|
- lib/countries/country.rb
|
231
231
|
- lib/countries/country/class_methods.rb
|
232
|
+
- lib/countries/country/conversion_methods.rb
|
232
233
|
- lib/countries/country/country_subdivision_methods.rb
|
233
234
|
- lib/countries/country/currency_methods.rb
|
234
235
|
- lib/countries/country/emoji.rb
|
@@ -855,7 +856,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
855
856
|
- !ruby/object:Gem::Version
|
856
857
|
version: '0'
|
857
858
|
requirements: []
|
858
|
-
rubygems_version: 3.5.
|
859
|
+
rubygems_version: 3.5.9
|
859
860
|
signing_key:
|
860
861
|
specification_version: 4
|
861
862
|
summary: Gives you a country object full of all sorts of useful information.
|