za-id-validator

South African identity number validator

Contributing to za-id-validator

Install

gem install za-id-validator

Usage

Just add to your Gemfile:

gem "za-id-validator", "0.1.0"

Then include it in a class

class Dude

  include ZaIdValidator

  validates_presence_of :identity_number
  validates_uniqueness_of :identity_number

  before_save do |dude|
    dude.validate_za_identity_number?(dude.identity_number)
  end

end

Copyright © 2012 Craig Paterson. See LICENSE for details.