companies_house_client 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -1
- data/lib/companies_house_client.rb +1 -0
- data/lib/companies_house_client/collection_parser.rb +3 -1
- data/lib/companies_house_client/models/appointment.rb +6 -0
- data/lib/companies_house_client/models/charge.rb +6 -0
- data/lib/companies_house_client/models/company.rb +5 -1
- data/lib/companies_house_client/models/filing_history.rb +7 -0
- data/lib/companies_house_client/models/officer.rb +2 -1
- data/lib/companies_house_client/models/registered_office_address.rb +6 -0
- data/lib/companies_house_client/version.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae7a9bca2c3c65f19f0a56ca47dac8ff16353d46
|
4
|
+
data.tar.gz: 7df0a18bab9de3e4ca353e40484efcc721a1cb02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2ea9b2e997ef34c5e887c7b136f1452e89d614475f5649e3a51a5f5ad038b73fb030e039fe05055e11974f081238801e7fee72ffb42f723f6b21a60a014256b
|
7
|
+
data.tar.gz: 84eb103022d3f9b55e8444cf8ab32a4f2d5f77c1e70782b31fb8fa16aefe91d5f71e341153f726d789fbf8f7d4710bc009beb8c1f4834a87fe3b7862f71d7cb9
|
data/README.md
CHANGED
@@ -61,10 +61,25 @@ c = CompaniesHouseClient::Company.find("company number")
|
|
61
61
|
c.officers #returns a collection of Officer objects.
|
62
62
|
```
|
63
63
|
|
64
|
+
If you just want a list of officers for a given company, you can save a request to the /company endpoint like this:
|
65
|
+
|
66
|
+
```
|
67
|
+
CompaniesHouseClient::Officer.all(company_id: "company number") #will return a collection directly from the officers endpoint
|
68
|
+
```
|
69
|
+
|
70
|
+
### Filing History
|
71
|
+
You can get a list of the company's filing history entries like this:
|
72
|
+
|
73
|
+
```
|
74
|
+
c = CompaniesHouseClient::Company.find("company number")
|
75
|
+
c.filing_histories #returns a collection of FilingHistory objects - note plural on the relation name
|
76
|
+
```
|
64
77
|
|
65
78
|
## To do
|
66
79
|
|
67
|
-
*
|
80
|
+
* There are Appointments and Charges endpoints set up, and they're documented in the API docs, but they return a 404 for all companies. No idea why.
|
81
|
+
* Some tests would be nice.
|
82
|
+
* There an issue with the [Her](https://github.com/remiprev/her) where it expects the child resource to have a reference to a parent, which this API doesn't. So you get `(<unknown path, missing `company_id`>)` in the responses for child objects. There is probably a solution.
|
68
83
|
|
69
84
|
# Licence
|
70
85
|
This gem is MIT licenced. Have fun!
|
@@ -12,7 +12,9 @@ module CompaniesHouseClient
|
|
12
12
|
def on_complete(env)
|
13
13
|
json = MultiJson.load(env[:body], symbolize_keys: true)
|
14
14
|
env[:body] = {
|
15
|
-
data: json.has_key?(:items) ? json[:items] : json
|
15
|
+
data: json.has_key?(:items) ? json[:items] : json,
|
16
|
+
errors: json[:errors],
|
17
|
+
metadata: json.except(:items)
|
16
18
|
}
|
17
19
|
end
|
18
20
|
end
|
@@ -1,6 +1,10 @@
|
|
1
1
|
module CompaniesHouseClient
|
2
2
|
class Company < Base
|
3
|
-
|
3
|
+
has_one :registered_office_address, path: "/registered-office-address"
|
4
|
+
has_many :officers, path: "/officers"
|
5
|
+
has_many :filing_histories, path: "/filing-history"
|
6
|
+
has_many :appointments, path: "/appointments"
|
7
|
+
has_many :charges, path: "/charges"
|
4
8
|
collection_path "/company"
|
5
9
|
primary_key :company_number
|
6
10
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: companies_house_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ed Jones
|
@@ -85,8 +85,12 @@ files:
|
|
85
85
|
- lib/companies_house_client/base.rb
|
86
86
|
- lib/companies_house_client/ca_path.rb
|
87
87
|
- lib/companies_house_client/collection_parser.rb
|
88
|
+
- lib/companies_house_client/models/appointment.rb
|
89
|
+
- lib/companies_house_client/models/charge.rb
|
88
90
|
- lib/companies_house_client/models/company.rb
|
91
|
+
- lib/companies_house_client/models/filing_history.rb
|
89
92
|
- lib/companies_house_client/models/officer.rb
|
93
|
+
- lib/companies_house_client/models/registered_office_address.rb
|
90
94
|
- lib/companies_house_client/version.rb
|
91
95
|
homepage: https://github.com/errorstudio/companies_house_client
|
92
96
|
licenses:
|