0.0
No commit activity in last 3 years
No release in over 3 years
Parses PESEL number. Validates PESEL, fetches birth date, sex and series number
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.8
~> 10.0
~> 0.37.0
 Project Readme

pesel_parser

Parses PESEL number. Validates PESEL, fetches birth date, sex and series number. Adds monkey patch for String and Fixnum objects -> inspect_pesel

Installation

Add this line to your application's Gemfile:

  gem 'pesel_parser'

And then execute:

$ bundle

Usage

  # Fixnum
  16211813887.inspect_pesel   # => PeselInspector object

  # String
  '16211813887'.inspect_pesel # => PeselInspector object

  # classic way
  PeselInspector.new(16211813887)   # => PeselInspector object
  # or
  PeselInspector.new('16211813887') # => PeselInspector object

PeselInspector object attr_readers

  • pesel (String)
  • sex (male or female, String)
  • series number (String)
  • birth_date (Date)

Example

  '16211813887'.inspect_pesel
 # =>
 # #<PeselInspector:0x00000004fefef8
 # @birth_date=#<Date: 2016-01-18 ((2457406j,0s,0n),+0s,2299161j)>,
 # @pesel="16211813887",
 # @series_number="1388",
 # @sex="female">