arcgis-opendata 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/client.rb +12 -4
- data/lib/opendata.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dc43e610cc33ebbdd228a80ac14d73cb7b06cca
|
4
|
+
data.tar.gz: 3a500b8608c83c8dcc4a7c0c7823c63c8eb7d867
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61621ee8e90785dba3e3391546f9331bf71128fa60f581add5925290186908243d19a39af2d75c7ea83836a142e8dd72cb73b0e6507f03b5d7b1f580beb121d8
|
7
|
+
data.tar.gz: 46d0888becf27bf9cd0256a3e8f5e6fd74c585468e367f1bc4ff2e8dfa5ef33f4eee4eaa1cbeb71d6088776d3feb0f9bb8856aa223087241e4bffecaffcc4708
|
data/lib/client.rb
CHANGED
@@ -3,21 +3,29 @@ require 'uri'
|
|
3
3
|
|
4
4
|
module Opendata
|
5
5
|
|
6
|
-
VERSION = '0.0.
|
6
|
+
VERSION = '0.0.2'.freeze
|
7
7
|
|
8
8
|
class Client
|
9
|
-
|
9
|
+
|
10
|
+
# Constructor for Opendata::Client instances
|
11
|
+
# @param url [String] the base url to the open data API
|
12
|
+
# @param options [Hash] assorted options for instantiating the Opendata::Client instance
|
13
|
+
# @return [Object] the Opendata::Client instance which is a simple wrapper around a Faraday::Connection instance
|
10
14
|
def initialize(url = nil, options = {})
|
11
15
|
opts = options.merge(DEFAULT_HEADERS)
|
12
16
|
@connection = Faraday.new(url, opts)
|
13
17
|
end
|
14
18
|
|
15
|
-
#
|
19
|
+
# Makes requests for 'logical collections' of Dataset resources (zero-to-many potential dataset resources)
|
20
|
+
# @param params [Hash] query parameters for Dataset resources
|
21
|
+
# @return [Object] Faraday::Response object
|
16
22
|
def dataset_list(params = {})
|
17
23
|
connection.get(DATASETS_API_PATH + param_to_query_string(params))
|
18
24
|
end
|
19
25
|
|
20
|
-
#
|
26
|
+
# Makes requests for a 'logical object' for a specific Dataset resource (zero-to-one potential dataset resources)
|
27
|
+
# @param id [String] The dataset id
|
28
|
+
# @param params [Hash] Additional request parameters
|
21
29
|
def dataset_show(id, params = {})
|
22
30
|
raise '#dataset_show must receive a dataset id' if id.nil?
|
23
31
|
|
data/lib/opendata.rb
CHANGED
@@ -2,7 +2,11 @@ require "client"
|
|
2
2
|
|
3
3
|
module Opendata
|
4
4
|
|
5
|
-
#
|
5
|
+
# Returns a new Opendata::Client instance
|
6
|
+
#
|
7
|
+
# @param url [String] the base url to the open data API
|
8
|
+
# @param options [Hash] assorted options for instantiating the Opendata::Client instance
|
9
|
+
# @return [Object] the Opendata::Client instance
|
6
10
|
class << self
|
7
11
|
def new(url, options={})
|
8
12
|
Client.new(url, options)
|