companies_house_hub 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/companies_house_hub.gemspec +2 -0
- data/lib/companies_house_hub/models/company.rb +12 -7
- data/lib/companies_house_hub/version.rb +1 -1
- metadata +29 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 427a9269943a75cb51ba365014cd273596f76179ef1d6a9fa69d50f73723c298
|
4
|
+
data.tar.gz: 287f7117eb64f50d6f9843866c194fd9cc08d9ca6935d26e8b09db6e11bb5505
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0a8808076471fa6f45ade50cca926b76c4e28cfbc978cb176d9a1d21abca0fdc906cd1ab7cd6d7538c672f425441a45a2a95e2322c5394c9789c9ed3c0e459d
|
7
|
+
data.tar.gz: b9519c438bea48f79f18205422761f9f33649343c27cfc090aeae1c799a17cb94a1aefb9578f1a35328cdb15ced7a986eba1f670f053ecc791d4c5ec61627582
|
data/companies_house_hub.gemspec
CHANGED
@@ -35,4 +35,6 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_development_dependency 'rubocop', '~> 0.54.0'
|
36
36
|
spec.add_development_dependency 'rubocop-rspec'
|
37
37
|
spec.add_development_dependency 'simplecov'
|
38
|
+
spec.add_development_dependency 'vcr'
|
39
|
+
spec.add_development_dependency 'webmock'
|
38
40
|
end
|
@@ -11,6 +11,9 @@ module CompaniesHouseHub
|
|
11
11
|
|
12
12
|
attr_reader :number, :name, :created_at, :address
|
13
13
|
|
14
|
+
alias company_number number
|
15
|
+
alias company_name name
|
16
|
+
|
14
17
|
def self.search(name, per_page:, start:)
|
15
18
|
options = { q: name, items_per_page: per_page, start_index: start }
|
16
19
|
|
@@ -24,17 +27,19 @@ module CompaniesHouseHub
|
|
24
27
|
|
25
28
|
result = get(url, params)
|
26
29
|
|
30
|
+
return unless result.success?
|
31
|
+
|
27
32
|
new(result.body)
|
28
33
|
end
|
29
34
|
|
30
35
|
def initialize(json = {})
|
31
|
-
@number = json.
|
32
|
-
@has_been_liquidated = json.
|
33
|
-
@jurisdiction = json.
|
34
|
-
@name = json.
|
35
|
-
@created_at = json.
|
36
|
-
@address = Address.new(json.
|
37
|
-
@status = json.
|
36
|
+
@number = json.dig(:company_number)
|
37
|
+
@has_been_liquidated = json.dig(:has_been_liquidated)
|
38
|
+
@jurisdiction = json.dig(:jurisdiction)
|
39
|
+
@name = json.dig(:company_name)
|
40
|
+
@created_at = json.dig(:date_of_creation)
|
41
|
+
@address = Address.new(json.dig(:registered_office_address))
|
42
|
+
@status = json.dig(:company_status)
|
38
43
|
end
|
39
44
|
|
40
45
|
def filing_histories
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: companies_house_hub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Otero
|
@@ -150,6 +150,34 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: vcr
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: webmock
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
153
181
|
description: A REST client for the UK Companies House API, including authentication
|
154
182
|
email:
|
155
183
|
- oterosantos@gmail.com
|