Skip to content

Commit e7db281

Browse files
committed
add :continent to output from Country database
1 parent a926003 commit e7db281

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

geoip.c

+2
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ VALUE rb_geoip_country_look_up(VALUE self, VALUE addr) {
236236
rb_hash_sset(hash, "country_code", rb_str_new2(GeoIP_country_code[country_id]));
237237
rb_hash_sset(hash, "country_code3", rb_str_new2(GeoIP_country_code3[country_id]));
238238
rb_hash_sset(hash, "country_name", rb_str_new2(GeoIP_country_name[country_id]));
239+
rb_hash_sset(hash, "continent", rb_str_new2(GeoIP_country_continent[country_id]));
239240

240241
return hash;
241242
}
@@ -270,6 +271,7 @@ VALUE rb_geoip_country_v6_look_up(VALUE self, VALUE addr) {
270271
rb_hash_sset(hash, "country_code", rb_str_new2(GeoIP_country_code[country_id]));
271272
rb_hash_sset(hash, "country_code3", rb_str_new2(GeoIP_country_code3[country_id]));
272273
rb_hash_sset(hash, "country_name", rb_str_new2(GeoIP_country_name[country_id]));
274+
rb_hash_sset(hash, "continent", rb_str_new2(GeoIP_country_continent[country_id]));
273275

274276
return hash;
275277
}

0 commit comments

Comments
 (0)