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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cdcf097862f3405032d89f74165de56710aa2463
4
- data.tar.gz: 38ced24922179e233896e275499b22a03aef4c50
3
+ metadata.gz: ac5edaf6b2699c854bb16519b28e27f79b40742c
4
+ data.tar.gz: f9565a20a66ead3e5722b361a08a276bcf3dea92
5
5
  SHA512:
6
- metadata.gz: aeed0bfd26ea51948654234ecaf67f38e9883325b17eff464cd140e72c36f90e03fde888267b53fd7dc72b65efe47a15ea5ae52166bef46cb19b08d0a07ee62f
7
- data.tar.gz: b455e7a6e1640e08d22a1332d6e4395b09581ac9def31102114a15177ff6ca9847bd1008c43057072efc2d710832a48a20fe3afbb2803c175996cd8c61b23c28
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, this return a plain ruby object with attributes as shown in the API documentation e.g. `company_name`.
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
@@ -1,3 +1,3 @@
1
1
  module CompaniesHouse
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  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.1.2
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-25 00:00:00.000000000 Z
11
+ date: 2016-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler