https://github.com/krzyzak/rpg
Real Pesel Generator
https://github.com/krzyzak/rpg
Last synced: 21 days ago
JSON representation
Real Pesel Generator
- Host: GitHub
- URL: https://github.com/krzyzak/rpg
- Owner: krzyzak
- License: mit
- Created: 2012-08-02T16:06:20.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-08-04T11:33:43.000Z (almost 13 years ago)
- Last Synced: 2025-05-27T02:11:29.772Z (about 1 month ago)
- Language: Ruby
- Size: 137 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rpg
This library aims to generate random (but correct!) PESEL numbers.
## Installation
Add this line to your application's Gemfile:
gem 'rpg'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rpg
## Usage
# Generate pesel for female, born at March 14, 1988
@pesel = Rpg::Pesel.new(gender: :female, date: "1988-03-14")
@pesel.generate # => "88031469364"# date can be Date object as well:
@pesel = Rpg::Pesel.new(gender: :male, date: Date.parse("1988-03-14"))
@pesel.generate # => "88031443355"#if you don't specify gender, it will be random.
@pesel = Rpg::Pesel.new(date: Date.parse("1960-10-10"))
@pesel.generate # => "60101014058"## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request