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 +4 -4
- data/lib/brreg.rb +4 -0
- data/lib/difi/version.rb +1 -1
- data/lib/difi.rb +6 -6
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 545bb95de50e05be6998f53b8e1a6fb07c11bfe6
|
4
|
+
data.tar.gz: 429cd47f52495bc6ed965a6b143687e4f43b48ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e96c5a60c439878657f9e4cff5b6eaedca7ea23762cceea9edd4699416777788905e8b8cff0958b17137371bb49d98758207b60f43efeb3a5a0ca8af09d8d48
|
7
|
+
data.tar.gz: 860ed2efe82ce9c2d45644e32c28bd6618690d9bff6f82c6ffc9aef887eb9ff52e36c871e0a30b7a1d1a29076e0bcb42415a1ed174b23cdf650bb8f251d53b9e
|
data/lib/brreg.rb
CHANGED
data/lib/difi/version.rb
CHANGED
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(
|
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 "
|
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
|
46
|
-
def search(
|
47
|
-
get "?" + URI.escape(
|
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.
|
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:
|
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.
|
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:
|