uk_companies_house 0.1.2 → 0.1.3

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: e4c579203b49a6d3ff42977665020ec97e8c8def99cbb2651095e37020b57e0a
4
- data.tar.gz: b278619719a36db144fb599cab5fa838598ac4113001d8457f60feaab5e203fe
3
+ metadata.gz: adb7c474c201c49f19311baf11c46fbbab695f04190dcf7b24f95d4a2282d992
4
+ data.tar.gz: 52ec4896036f2b3db7b64d030f599b13996497053d82d8125edc05af2a43d36a
5
5
  SHA512:
6
- metadata.gz: f551b36426a6a46c9a3602cf0bc43777b80de8d8572096b1298167c1614b956c8a19b1d8ef092a2af603d8e3e566a7c82d119550126ed2f857de8e172c5a28a0
7
- data.tar.gz: a9d9f9af01a280ea5b4d911fc4a803235a96eded0b140c3f95643f1aa9f09b09a822a70411be01fce80e66eb7627988cc5ae87b3246fccf5f0050654a50bca7a
6
+ metadata.gz: 21b3e31314a518ac0ba8f6e99b8ea4a401a2324b1fce56313db45df8a426627740733cb153b866fb98c2b455861eb852564a4f01968d0c520ffcd5c03698a3e2
7
+ data.tar.gz: afa3a72adf4abb9edce3cf20f1e0df3e4615852053387eaf782e0d6d1af3c34cbffdb7b24321b3759808f42a7aafb40a71b0741909ff1aa592714f055b3902cd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- uk_companies_house (0.1.2)
4
+ uk_companies_house (0.1.2.1)
5
5
  faraday
6
6
  faraday_middleware
7
7
 
@@ -1,4 +1,5 @@
1
1
  module UkCompaniesHouse
2
+
2
3
  class Client
3
4
  attr_accessor :api_key
4
5
 
@@ -28,7 +29,8 @@ module UkCompaniesHouse
28
29
  connection.get do |req|
29
30
  req.url url
30
31
  req.headers['Content-Type'] = 'application/json'
31
- req.body = data.to_json
32
+ req.params = data
33
+ #req.body = data.to_json
32
34
  end
33
35
  end
34
36
 
@@ -7,16 +7,20 @@ module UkCompaniesHouse
7
7
  end
8
8
 
9
9
  # Search company information
10
- def search(q, items_per_page = nil, start_index = nil)
11
- params = {q: q,
12
- items_per_page: items_per_page,
13
- start_index: start_index}
14
- client.get("search/companies/", params)
10
+ def search(query, items_per_page = nil, start_index = nil)
11
+ params = {q: query}
12
+ if items_per_page
13
+ params[:items_per_page] = items_per_page
14
+ end
15
+ if start_index
16
+ params[:start_index] = start_index
17
+ end
18
+ client.get("search/companies", params)
15
19
  end
16
20
 
17
21
  # Basic company information
18
22
  def basic_information(company_number)
19
- number = company_number.gsub(/[^a-zA-Z0-9]/, "")
23
+ number = "#{company_number}".gsub(/[^a-zA-Z0-9]/, "")
20
24
  client.get("/company/#{number}")
21
25
  end
22
26
 
@@ -37,9 +41,13 @@ module UkCompaniesHouse
37
41
 
38
42
  # Get the filing history list of a company
39
43
  def filing_history_list(company_number, category = nil, items_per_page = nil, start_index = nil)
40
- params = {category: category,
41
- items_per_page: items_per_page,
42
- start_index: start_index}
44
+ params = {category: category}
45
+ if items_per_page
46
+ params[:items_per_page] = items_per_page
47
+ end
48
+ if start_index
49
+ params[:start_index] = start_index
50
+ end
43
51
  client.get("company/#{company_number}/officers/", params)
44
52
  end
45
53
 
@@ -55,7 +63,13 @@ module UkCompaniesHouse
55
63
 
56
64
  # List of charges for a company.
57
65
  def charges(company_number, items_per_page = nil, start_index = nil)
58
- params = {items_per_page: items_per_page, start_index: start_index}
66
+ params = {}
67
+ if items_per_page
68
+ params[:items_per_page] = items_per_page
69
+ end
70
+ if start_index
71
+ params[:start_index] = start_index
72
+ end
59
73
  client.get("company/#{company_number}/charges/", params)
60
74
  end
61
75
 
@@ -11,7 +11,7 @@ module UkCompaniesHouse
11
11
  params = {q: q,
12
12
  items_per_page: items_per_page,
13
13
  start_index: start_index}
14
- client.get("search/", params)
14
+ client.get("search", params)
15
15
  end
16
16
 
17
17
  #Search company information
@@ -19,7 +19,7 @@ module UkCompaniesHouse
19
19
  params = {q: q,
20
20
  items_per_page: items_per_page,
21
21
  start_index: start_index}
22
- client.get("search/companies/", params)
22
+ client.get("search/companies", params)
23
23
  end
24
24
 
25
25
  # Search for officer information
@@ -35,7 +35,7 @@ module UkCompaniesHouse
35
35
  params = {q: q,
36
36
  items_per_page: items_per_page,
37
37
  start_index: start_index}
38
- client.get("search/disqualified-officers/", params)
38
+ client.get("search/disqualified-officers", params)
39
39
  end
40
40
 
41
41
  end
@@ -0,0 +1,11 @@
1
+ rails g model Contact title first_name last_name email phone position date_of_birth:date passport passport_number contact_type notes country:references
2
+
3
+
4
+ proof_address
5
+ postcode
6
+
7
+ rails g model Address address postcode country:references location latitude:float longitude:float
8
+
9
+
10
+ rails g model ContactAddresses address:references contact:references primary:boolean
11
+ rails g model CompanyAddresses address:references company:references primary:boolean type:integer:index
@@ -1,3 +1,3 @@
1
1
  module UkCompaniesHouse
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uk_companies_house
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eugeniu Tambur
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-13 00:00:00.000000000 Z
11
+ date: 2018-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -102,8 +102,10 @@ files:
102
102
  - lib/uk_companies_house/company.rb
103
103
  - lib/uk_companies_house/officer.rb
104
104
  - lib/uk_companies_house/search.rb
105
+ - lib/uk_companies_house/title, first_name, last_name, email, phone, positi
105
106
  - lib/uk_companies_house/version.rb
106
107
  - uk_companies_house-0.1.1.gem
108
+ - uk_companies_house-0.1.2.gem
107
109
  - uk_companies_house.gemspec
108
110
  homepage: https://github.com/zinggg/uk_companies_house
109
111
  licenses:
@@ -125,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
127
  version: '0'
126
128
  requirements: []
127
129
  rubyforge_project:
128
- rubygems_version: 2.7.6
130
+ rubygems_version: 2.7.7
129
131
  signing_key:
130
132
  specification_version: 4
131
133
  summary: Ruby API to UK Companies House.