difi 0.0.3 → 0.0.4

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: 82073c53576e9c05499f39540ce27f8a43e99f33
4
- data.tar.gz: 1a68c7a69e2e603b3107b42c9eaf841f9811b3b5
3
+ metadata.gz: 545bb95de50e05be6998f53b8e1a6fb07c11bfe6
4
+ data.tar.gz: 429cd47f52495bc6ed965a6b143687e4f43b48ce
5
5
  SHA512:
6
- metadata.gz: 9dfdd4b3086368e25fca314d5525272a65485d5934c8eaf699bfcf582f20a63e93299da9680916de23bc7b1e1613a159a2bf211b51753ba2ae45a0003216e04e
7
- data.tar.gz: 3a4730cbba59492821a46a9a682f116f6057bf613de77e7e5ae305859890eefe4d194054a747a34b81eca21e475acfd497b2b3c7c23710a9c018962caaa50c0a
6
+ metadata.gz: 7e96c5a60c439878657f9e4cff5b6eaedca7ea23762cceea9edd4699416777788905e8b8cff0958b17137371bb49d98758207b60f43efeb3a5a0ca8af09d8d48
7
+ data.tar.gz: 860ed2efe82ce9c2d45644e32c28bd6618690d9bff6f82c6ffc9aef887eb9ff52e36c871e0a30b7a1d1a29076e0bcb42415a1ed174b23cdf650bb8f251d53b9e
data/lib/brreg.rb CHANGED
@@ -2,6 +2,10 @@
2
2
  module Brreg
3
3
  class Registry
4
4
  extend Difi
5
+
6
+ def self.dataset
7
+ "brreg/enhetsregisteret"
8
+ end
5
9
  end
6
10
 
7
11
  # The public Norwegian business registry dataset
data/lib/difi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Difi
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/difi.rb CHANGED
@@ -13,7 +13,7 @@ module Difi
13
13
 
14
14
  # The API source URL
15
15
  def url
16
- @@url ||= "http://hotell.difi.no/api/json/"
16
+ @@url ||= "http://hotell.difi.no/api/json"
17
17
  end
18
18
 
19
19
  # The API connection
@@ -32,19 +32,19 @@ module Difi
32
32
 
33
33
  # Perform a GET HTTP query on the current dataset
34
34
  def get(query)
35
- @@response = conn.get("#{url}/#{dataset}#{query}")
35
+ @@response = conn.get([url, dataset, query].join("/"))
36
36
  end
37
37
 
38
38
  # Return the fields of the current dataset
39
39
  def fields
40
- get "/fields"
40
+ get "fields"
41
41
  json
42
42
  end
43
43
 
44
44
  # Search for entries from the current dataset with the given fields
45
- # Input is expected to be a Hash
46
- def search(fields)
47
- get "?" + URI.escape(fields.collect{|k,v| "#{k}=#{v}"}.join('&'))
45
+ # Input is expected to be a String
46
+ def search(string)
47
+ @@response = conn.get [url, dataset].join("/") + "?query=" + URI.escape(string)
48
48
  json
49
49
  end
50
50
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: difi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Runar Ingebrigtsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-26 00:00:00.000000000 Z
11
+ date: 2016-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -104,8 +104,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  version: '0'
105
105
  requirements: []
106
106
  rubyforge_project:
107
- rubygems_version: 2.4.4
107
+ rubygems_version: 2.2.2
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Query the Difi API
111
111
  test_files: []
112
+ has_rdoc: