Skip to content
Ruby library to validate Turkis Republic ID (TC Kimlik NO)
Ruby Shell
Branch: master
Clone or download
Latest commit 359193c Apr 20, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin upload completed parts Sep 1, 2015
lib update gem version Sep 3, 2015
spec Add some tests Sep 3, 2015
.gitignore upload completed parts Sep 1, 2015
.rspec upload completed parts Sep 1, 2015
.travis.yml upload completed parts Sep 1, 2015
Gemfile
README.md remove broken link Apr 20, 2017
Rakefile upload completed parts Sep 1, 2015
tc_validator-0.1.2.gem update documatation after pushing Sep 3, 2015
tc_validator.gemspec update documatation after pushing Sep 3, 2015

README.md

TcValidator

Ruby library to validate Turkish Republic ID (TC Kimlik NO). TcValidator can validate TC ID from formal website tckimlik.nvi.gov.tr.

It needs Turkish Republic ID (TC Kimlik No), first name, last name and birth year to try the validation.

TcValidator also using Savon gem as runtime dependency for SOAP client.

Installation

Add this line to your application's Gemfile:

gem 'tc_validator'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tc_validator

Usage

Pass TC ID, first name, last name and birth year as string parameters to validator.

require 'tc_validator'
TcValidator.check_tc_id(tc_id, name, last_name, birth_year)

More detailed examples:

If TC ID square with TC Kimlik No Algorithm TcValidator returns true or false

# if 'xxxxxxxxxxx' square with TC Kimlik No Algorithm and not Sadık's ID
# The below command returns false
TcValidator.check_tc_id('xxxxxxxxxxx', 'Sadık', 'Ay', '19xx')
=> false
# if 'xxxxxxxxxxx' square with TC Kimlik No Algorithm and other parameters square with Kerim's infos
# The below command returns true
TcValidator.check_tc_id('xxxxxxxxxxx', 'Kerim Rıza', 'Karalı', '19xx')
=> true

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request
You can’t perform that action at this time.