Coder Social home page Coder Social logo

eik_validator's Introduction

EikValidator

This gem allows you to validate whether a Bulgarian EIK (UIC - Unique Identifier Code) is valid or not. It follows the algorhitm described here.

Installation

Add this line to your application's Gemfile:

gem 'eik_validator'

And then execute:

$ bundle

Or install it yourself as:

$ gem install eik_validator

Usage

The usage is pretty straightforward:

EikValidator.validate('123456789') # => false
EikValidator.validate('020469788') # => true

EikValidator.validate('1234567891234') # => false
EikValidator.validate('1213961230342') # => true

Or if you want to use it inside a model:

validates :field_name, eik: true

Changelog

[0.0.4] - 2015-02-06

  • Fixed a dependency typo.

[0.0.3] - 2015-02-06 [YANKED]

  • Added ActiveModel validation support.

[0.0.1] - 2015-02-05

  • Initial release.

Contributing

This is my first gem ever so suggestions are more that appreciated. Bug reports and pull requests are welcome on GitHub at https://github.com/veskoy/eik_validator.

eik_validator's People

Contributors

st0yanov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.