companies_house_hub 0.0.13 → 0.0.14

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
  SHA256:
3
- metadata.gz: 115c205b6f8d479b2becb18484c286d3b3b2aa91689449ede120bfe7eb6412ee
4
- data.tar.gz: 6e0c4c7f71f1691f28def10e5a6108d1223bb5d2be2f18ecb65ac2745fe87565
3
+ metadata.gz: d1df1e95e70af9bf7d63ab8d0d96e701692beeb3e132c84438ab9531488ee936
4
+ data.tar.gz: 713df242f9a48182170c450748d14b3b8b0b321969adc2678eef960ba5acc503
5
5
  SHA512:
6
- metadata.gz: db678fb5970838f06f01b275197340196c65ad10076d96a19bb5c92d38f8f5ace0a8704895ef98aa8f2cd2c727b626abaecd3c5ed0c4d771962f522918288f0d
7
- data.tar.gz: 4314aea167a608f5e4cb60c4432fd63d9fc756348ae89c768d8db3376ac62a3b69dcd28ee8c40cd9826554b9532d76a1c51bbd928bcbc0de17beab88c9d82847
6
+ metadata.gz: e71bb8896b010072d7ad78f2ccbb1cf8213d73ece90308a425e51b7b579791797eac970c580b35a160439e243947238fb0ba9db359754590b0785c1f64094531
7
+ data.tar.gz: fdeabdc9834742fbb7e51fc4855ba46424e002eeb8b4562c56e1e8ed507591648888514ef0b3653457121281e9de57d75c1d9e2c32220dc2603c1d1f749bb47e
@@ -7,6 +7,7 @@ module CompaniesHouseHub
7
7
  attr_reader :address_line1, :address_line2, :postal_code, :locality, :country
8
8
 
9
9
  def initialize(json = {})
10
+ p json
10
11
  @address_line1 = json.dig(:address_line_1)
11
12
  @address_line2 = json.dig(:address_line_2)
12
13
  @country = json.dig(:country)
@@ -22,7 +22,7 @@ module CompaniesHouseHub
22
22
 
23
23
  result = get(SEARCH_PATH, options)
24
24
 
25
- result.body.each { |company_json| new(company_json) }
25
+ result.body[:items].map { |company_json| new(company_json) }
26
26
  end
27
27
 
28
28
  def self.find(company_number, params = {})
@@ -36,16 +36,17 @@ module CompaniesHouseHub
36
36
  end
37
37
 
38
38
  def initialize(json = {})
39
+ p json
39
40
  @number = json.dig(:company_number)
40
41
  @has_been_liquidated = json.dig(:has_been_liquidated)
41
42
  @jurisdiction = json.dig(:jurisdiction)
42
- @name = json.dig(:company_name)
43
+ @name = json.dig(:company_name) || json.dig(:title)
43
44
  @created_at = json.dig(:date_of_creation)
44
- @address = Address.new(json.dig(:registered_office_address))
45
+ @address = Address.new(json.dig(:registered_office_address) || json.dig(:address))
45
46
  @status = json.dig(:company_status)
46
- @type = json.dig(:type)
47
+ @type = json.dig(:type) || json.dig(:company_type)
47
48
  @accounts = json.dig(:accounts)
48
- @full_address = @address.full
49
+ @full_address = json.dig(:address_snippet) || @address.full
49
50
  end
50
51
 
51
52
  def filing_histories
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CompaniesHouseHub
4
- VERSION = '0.0.13'
4
+ VERSION = '0.0.14'
5
5
  end
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.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Otero