registeruz 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -5
- data/lib/registeruz/models/subject.rb +42 -13
- data/lib/registeruz/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b03027106a30e9fb49a2c865ac4a08e631c5e7fc
|
|
4
|
+
data.tar.gz: 4c5ae99cec78ce3630847db9745b18eb6c42774f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5152696ac88108545ecfbfce6dcc9259d7371777ae2486d0a2f02df1de60716d9499c8cb5d4597288d8bfd15f9132764f0a9d639dec66a1b02f61bd217093283
|
|
7
|
+
data.tar.gz: 69bb2e955be3b7a2a0ea04d8503d84cafe077f74318ff9b12319c94b9ba3300dc986c6767cfaae2143f31dab8ed9a7fddcf4d52e0f1f930cd38defb1beaa6f25
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://travis-ci.org/redrick/registeruz)
|
|
4
4
|
|
|
5
|
-
Gem build as SVK alternation of [
|
|
5
|
+
Gem build as SVK alternation of [CZ Ares gem](https://github.com/ucetnictvi-on-line/ares.rb)
|
|
6
6
|
|
|
7
7
|
Allows you to get company/person information based on their ICO (we purely use
|
|
8
8
|
it this way, but could be bent to use it otherwise :) )
|
|
@@ -12,7 +12,7 @@ it this way, but could be bent to use it otherwise :) )
|
|
|
12
12
|
Add this line to your application's Gemfile:
|
|
13
13
|
|
|
14
14
|
```ruby
|
|
15
|
-
gem '
|
|
15
|
+
gem 'registeruz'
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
And then execute:
|
|
@@ -21,7 +21,7 @@ And then execute:
|
|
|
21
21
|
|
|
22
22
|
Or install it yourself as:
|
|
23
23
|
|
|
24
|
-
$ gem install
|
|
24
|
+
$ gem install registeruz
|
|
25
25
|
|
|
26
26
|
## Usage
|
|
27
27
|
|
|
@@ -167,7 +167,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
167
167
|
|
|
168
168
|
## Contributing
|
|
169
169
|
|
|
170
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/
|
|
170
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/registeruz. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
|
171
171
|
|
|
172
172
|
## License
|
|
173
173
|
|
|
@@ -175,4 +175,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
175
175
|
|
|
176
176
|
## Code of Conduct
|
|
177
177
|
|
|
178
|
-
Everyone interacting in the GemTemplate project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/
|
|
178
|
+
Everyone interacting in the GemTemplate project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/registeruz/blob/master/CODE_OF_CONDUCT.md).
|
|
@@ -2,13 +2,15 @@ module Registeruz
|
|
|
2
2
|
module Models
|
|
3
3
|
class Subject
|
|
4
4
|
attr_accessor :id, :name, :city, :street, :postal_code, :founded_at,
|
|
5
|
-
:closed_at, :
|
|
6
|
-
:
|
|
7
|
-
:ico, :dic, :
|
|
5
|
+
:closed_at, :legal_form_id, :organization_size_id,
|
|
6
|
+
:ownership_type_id, :region_id, :district_id, :residence_id,
|
|
7
|
+
:data_origin, :updated_at, :ico, :dic, :sk_nace_code_id,
|
|
8
|
+
:consolidated
|
|
8
9
|
|
|
9
10
|
# rubocop:disable Metrics/AbcSize
|
|
10
11
|
# rubocop:disable Metrics/MethodLength
|
|
11
12
|
def initialize(body)
|
|
13
|
+
@body = body
|
|
12
14
|
@id = body['id']
|
|
13
15
|
@name = body['nazovUJ']
|
|
14
16
|
@city = body['mesto']
|
|
@@ -16,24 +18,51 @@ module Registeruz
|
|
|
16
18
|
@postal_code = body['psc']
|
|
17
19
|
@founded_at = Time.parse body['datumZalozenia']
|
|
18
20
|
@closed_at = Time.parse body['datumZrusenia'] if body['datumZrusenia']
|
|
19
|
-
@
|
|
20
|
-
|
|
21
|
-
@
|
|
22
|
-
|
|
23
|
-
@
|
|
24
|
-
|
|
25
|
-
@region = ::Registeruz::Api::Codebook.find('kraje', body['kraj'])
|
|
26
|
-
@district = ::Registeruz::Api::Codebook.find('okresy', body['okres'])
|
|
27
|
-
@residence = ::Registeruz::Api::Codebook.find('sidla', body['sidlo'])
|
|
21
|
+
@legal_form_id = body['pravnaForma']
|
|
22
|
+
@organization_size_id = body['velkostOrganizacie']
|
|
23
|
+
@ownership_type_id = body['druhVlastnictva']
|
|
24
|
+
@region_id = body['kraj']
|
|
25
|
+
@district_id = body['okres']
|
|
26
|
+
@residence_id = body['sidlo']
|
|
28
27
|
@data_origin = body['zdrojDat']
|
|
29
28
|
@updated_at = Time.parse body['datumPoslednejUpravy']
|
|
30
29
|
@ico = body['ico']
|
|
31
30
|
@dic = body['dic']
|
|
32
|
-
@
|
|
31
|
+
@sk_nace_code_id = body['skNace']
|
|
33
32
|
@consolidated = body['konsolidovana']
|
|
34
33
|
end
|
|
35
34
|
# rubocop:enable Metrics/MethodLength
|
|
36
35
|
# rubocop:enable Metrics/AbcSize
|
|
36
|
+
|
|
37
|
+
def legal_form
|
|
38
|
+
::Registeruz::Api::Codebook.find('pravne-formy', @body['pravnaForma'])
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def organization_size
|
|
42
|
+
::Registeruz::Api::Codebook
|
|
43
|
+
.find('velkosti-organizacie', @body['velkostOrganizacie'])
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def ownership_type
|
|
47
|
+
::Registeruz::Api::Codebook
|
|
48
|
+
.find('druhy-vlastnictva', @body['druhVlastnictva'])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def region
|
|
52
|
+
::Registeruz::Api::Codebook.find('kraje', @body['kraj'])
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def district
|
|
56
|
+
::Registeruz::Api::Codebook.find('okresy', @body['okres'])
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def residence
|
|
60
|
+
::Registeruz::Api::Codebook.find('sidla', @body['sidlo'])
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def sk_nace_code
|
|
64
|
+
::Registeruz::Api::Codebook.find('sk-nace', @body['skNace'])
|
|
65
|
+
end
|
|
37
66
|
end
|
|
38
67
|
end
|
|
39
68
|
end
|
data/lib/registeruz/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: registeruz
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrej Antas
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-03-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|