Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krzyzak/rpg
Real Pesel Generator
https://github.com/krzyzak/rpg
Last synced: about 2 months 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 (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-08-04T11:33:43.000Z (over 12 years ago)
- Last Synced: 2023-03-13T11:35:54.000Z (almost 2 years ago)
- Language: Ruby
- Size: 137 KB
- Stars: 2
- Watchers: 2
- 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