I’ve released a new version of turkish_id gem.

Now, it supports querying ID numbers for people that are not a Turkish citizen but are registered in the blue card registry. The numerical validation works the same way, so no differences there. There is a separate endpoint for querying ID numbers that are in the blue card registry; hence the new foreigner_registered? method.

Here’s how you can use it. First, create a new instance:

identity_number = TurkishId.new("99911494534")

Use valid? method to check numerical validity:

identity_number.valid?  #=> true

Use foreigner_registered? method to query the foreigner registry:

identity_number.foreigner_registered?("Yukihiro", "Matsumoto", 14, 4, 1965)  #=> false

And that’s how you can query a person with a blue card. Hope you find it helpful.

Happy hacking!