https://github.com/arsredovisning-online/orgnummer
Util for managing swedish organisationsnummer
https://github.com/arsredovisning-online/orgnummer
Last synced: 5 months ago
JSON representation
Util for managing swedish organisationsnummer
- Host: GitHub
- URL: https://github.com/arsredovisning-online/orgnummer
- Owner: arsredovisning-online
- License: mit
- Created: 2015-02-19T17:37:53.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2022-03-18T21:54:13.000Z (about 3 years ago)
- Last Synced: 2024-11-02T16:04:31.174Z (5 months ago)
- Language: Ruby
- Size: 8.79 KB
- Stars: 4
- Watchers: 8
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-sweden - Ruby
README
# Orgnummer
Util for creation and validation of the swedish organisationsnummer
## Installation
Add this line to your application's Gemfile:
gem 'orgnummer'
And then execute:
$ bundle
Or install it yourself as:
$ gem install orgnummer
## Changelog
0.1.1. Added implementation of eql? and hash0.1.0. Added support for resolving swedish organization types
0.0.1. Initial version
## Usage
```ruby
bolag = Orgnummer.new(5568610827)
# bolag = Orgnummer.new('5568610827') is valid
# bolag = Orgnummer.new('556861-0827') is valid
# bolag = Orgnummer.new('55') is valid but bolag.valid? will be falseif bolag.valid?
#do somethingif bolag.type_of_organization eq :aktiebolag
#do something```
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request