companies_house_api 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/companies_house/company_information.rb +14 -0
- data/lib/companies_house/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: ac5edaf6b2699c854bb16519b28e27f79b40742c
|
4
|
+
data.tar.gz: f9565a20a66ead3e5722b361a08a276bcf3dea92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8267a5af6553ef4a2f99376d959af80e4dacdf6e6af469b53a30fc18bdd94eefa72194ad28b02764de84e75f6937cfc73660bea5bc0cb07e18edc4c78bc3e332
|
7
|
+
data.tar.gz: 64124d0256681725b2a15ca71c864d746c48aba4e434853cc873110dda5d6c59a4f79b50712b8b8779d8b4ad7d8734549a073bf269a9c82a90e7a6b5e896432d
|
data/README.md
CHANGED
@@ -46,9 +46,10 @@ To retrieve company information:
|
|
46
46
|
```ruby
|
47
47
|
ch = CompaniesHouse::CompanyInformation.new
|
48
48
|
ch.company_profile("07577596")
|
49
|
+
ch.registered_office_address("07577596")
|
49
50
|
```
|
50
51
|
|
51
|
-
Again,
|
52
|
+
Again, these return plain ruby objects with attributes as shown in the API documentation for the named methods.
|
52
53
|
|
53
54
|
## Contributing
|
54
55
|
|
@@ -20,6 +20,20 @@ module CompaniesHouse
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
def registered_office_address(company_number)
|
24
|
+
# GET /company/company_number/registered-office-address
|
25
|
+
url = "company/#{company_number}/registered-office-address"
|
26
|
+
response = @@conn.get url
|
27
|
+
result = JSON.parse(response.body, object_class: OpenStruct)
|
28
|
+
if result.respond_to?(:errors)
|
29
|
+
if result.errors[0][:error] == "company-profile-not-found"
|
30
|
+
raise CompanyNotFoundError.new("A company with that registration number could not be found")
|
31
|
+
end
|
32
|
+
else
|
33
|
+
return result
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
23
37
|
end
|
24
38
|
|
25
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: companies_house_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robin Fisher
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|