nzbn 0.1.1 → 0.1.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 +10 -3
- data/lib/nzbn.rb +10 -0
- data/lib/nzbn/version.rb +1 -1
- data/nzbn.gemspec +2 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc28d59b4a7c4dc9c77238af7eeb51ec1410fe25
|
4
|
+
data.tar.gz: 7a33e4e396c173ebce722c3923bbcebb1e2741db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1d9c5dcd0497c1ba0d3d2265fe9457873d56d290ae7769d1dab2912a5cf6c80dc0ced76719a1981db69bcd1b6820c1d41c99c1110a224da63caf20f19d87bd9
|
7
|
+
data.tar.gz: ecb9322f9810a64c86a02c6353fa5d8c1eb30b08627800a4bd3cee81b2bcfbc0f14b6f14b268e8ff58fe40865813e822be2d59e672f1e923083e853338f431c3
|
data/README.md
CHANGED
@@ -27,9 +27,9 @@ Or install it yourself as:
|
|
27
27
|
|
28
28
|
You will also need to set the following ENV variables, in order to access the API. These can be gound on the business.govt.nz website under your login.
|
29
29
|
|
30
|
-
$ NZBN_ID=
|
30
|
+
$ NZBN_ID=
|
31
31
|
|
32
|
-
$ NZBN_SECRET=
|
32
|
+
$ NZBN_SECRET=
|
33
33
|
|
34
34
|
|
35
35
|
## Usage
|
@@ -45,10 +45,17 @@ Full company details based on a unique 'Company Number' will be returned.
|
|
45
45
|
|
46
46
|
### Search for a Company
|
47
47
|
|
48
|
-
$
|
48
|
+
$ NZBN.entities(search_term, entity_status, page_length)
|
49
49
|
* entity_status = "registered" to filter the search for registered entities only (defaults to registered)*
|
50
50
|
* page_length = 50 to return the top 50 results only (max of 200, defaults to 50)*
|
51
51
|
|
52
|
+
### Entity Filings
|
53
|
+
|
54
|
+
$ NZBN.filings(nzbn)
|
55
|
+
* where nzbn is the entity nzbn
|
56
|
+
|
57
|
+
Returns array of filings associated with the entity
|
58
|
+
|
52
59
|
All output is returned as parsed JSON. Within a rails view it can be quickly navigated with [Nokogiri](https://github.com/sparklemotion/nokogiri) or similar.
|
53
60
|
|
54
61
|
|
data/lib/nzbn.rb
CHANGED
@@ -29,6 +29,16 @@ module NZBN
|
|
29
29
|
return JSON.parse(r.body_str)
|
30
30
|
end
|
31
31
|
|
32
|
+
def self.filings(nzbn)
|
33
|
+
r = Curl::Easy.new("https://api.business.govt.nz/services/v3/nzbn/entities/#{nzbn}/filings") do |curl|
|
34
|
+
curl.headers['Authorization'] = 'Bearer ' + access_token
|
35
|
+
curl.http_auth_types = :basic
|
36
|
+
curl.verbose = true
|
37
|
+
end
|
38
|
+
r.perform
|
39
|
+
return JSON.parse(r.body_str)
|
40
|
+
end
|
41
|
+
|
32
42
|
|
33
43
|
|
34
44
|
private
|
data/lib/nzbn/version.rb
CHANGED
data/nzbn.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nzbn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- T Pearse
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: curb
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.96'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.96'
|
41
55
|
description: Search, update details and manage New Zealand companies through the NZBN
|
42
56
|
register.
|
43
57
|
email:
|
@@ -77,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
91
|
version: '0'
|
78
92
|
requirements: []
|
79
93
|
rubyforge_project:
|
80
|
-
rubygems_version: 2.
|
94
|
+
rubygems_version: 2.6.12
|
81
95
|
signing_key:
|
82
96
|
specification_version: 4
|
83
97
|
summary: Simple and fast authenticating ruby API wrapper for the NZBN API
|