arcgis-opendata 0.0.6.1 → 0.0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/client.rb +31 -1
  3. data/lib/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7ce8ba7a55091fc17bce28e6d22fab327e7c390
4
- data.tar.gz: 54ac2e9fdf640bb8625dc9de816b8f7c413d9041
3
+ metadata.gz: eefd21b860fbf351964f16b82afaeb82218a9bd4
4
+ data.tar.gz: 4b4ac871e146aee342dede7d3535692744a62741
5
5
  SHA512:
6
- metadata.gz: a6483cceec52a6c9a4e5516de800acfbe29d515b1c26d59b104ae52562e83b51f0652f144f884d4583e16bd6754a944ff20ca66aecbfff81077b7a80fe7b6ebb
7
- data.tar.gz: 69d6b66e9b6332e8e23b59638b1cb860bbfeed02648e3a2be68425c813effbf251fee54e4996283194a59c41364a0f458ff4983e9343e0897e606e99e43e6d62
6
+ metadata.gz: 89a93d2a533f92bf00b9b0a922bc9bd9ef6958d6f8585aaa98bfbdb29236ca5daddaa804ff49af149d8711c5452138262c4288a20145dc9b1ed849df7d4fbe6b
7
+ data.tar.gz: 6e40a3bfca72a94794af5cc3c3ca3469d01378b26224715b29b30a02445d6b6eec4d76787bf1d65b9313be79be733236eb892c522d6a5002b5602e3074852349
data/lib/client.rb CHANGED
@@ -16,7 +16,20 @@ module Opendata
16
16
  end
17
17
 
18
18
  # Makes requests for 'logical collections' of Dataset resources (zero-to-many potential dataset resources)
19
- # @param params [Hash] query parameters for Dataset resources
19
+ # @param [Hash] params query parameters for Dataset resources
20
+ # @option params [String] :q The query string for searching against datasets
21
+ # @option params [String] :include Comma-separate list of related resources to include. valid options are: 'organizations', 'groups', 'sites', 'items'
22
+ # @option params [String] :sort Sort criteria for the request. prepend a '-' to make the sort descending.
23
+ # @option params [Hash] :page Paging on the request. use { page: {size: Integer}} for page size and { page: { number: Integer}} for the page number
24
+ # @option params [Hash] :fields The attribute subset you want returned for each object. Use like {fields: { datasets: 'title,url'}}
25
+ #
26
+ # @example Search for census datasets, 25 per page and include their related organizations and sites
27
+ # client = Opendata.new('https://opendata.arcgis.com')
28
+ # client.dataset_list(q: 'census', page: { size: 25 }, include: 'organizations,sites')
29
+ # @example Search for parcel datasets, second page, and include their related organizations and filter the dataset fields to title and url
30
+ # client = Opendata.new('https://opendata.arcgis.com')
31
+ # client.dataset_list(q: 'parcels', page: { number: 2 }, include: 'organizations', fields: { datasets: 'title,url'})
32
+ #
20
33
  # @return [Object] Faraday::Response object
21
34
  def dataset_list(params = {})
22
35
  connection.get(dataset_list_url(params))
@@ -24,6 +37,11 @@ module Opendata
24
37
 
25
38
  # Makes requests for 'logical collections' of Dataset resources (zero-to-many potential dataset resources)
26
39
  # @param params [Hash] query parameters for Dataset resources
40
+ # @example Get the request url for a search for census datasets, 25 per page and include their related organizations and sites
41
+ # client = Opendata.new('https://opendata.arcgis.com')
42
+ # client.dataset_list_url(q: 'census', page: { size: 25 }, include: 'organizations,sites')
43
+ # #=> "/api/v2/datasets?q=census&page%5Bsize%5D=25&include=organizations%2Csites"
44
+ #
27
45
  # @return [String] request url based on the parameters specfied
28
46
  def dataset_list_url(params = {})
29
47
  DATASETS_API_PATH + param_to_query_string(params)
@@ -32,6 +50,14 @@ module Opendata
32
50
  # Makes requests for a 'logical object' for a specific Dataset resource (zero-to-one potential dataset resources)
33
51
  # @param id [String] The dataset id
34
52
  # @param params [Hash] Additional request parameters
53
+ #
54
+ # @example Retrive a dataset and related organizations and sites
55
+ # client = Opendata.new('https://opendata.arcgis.com')
56
+ # client.dataset_show('c92b122901ad40ee897d36b1a21f3187_11', include: 'organizations,sites')
57
+ #
58
+ # @example Retrive a dataset and specify a subset of fields (title,url,description,thumbnail)
59
+ # client = Opendata.new('https://opendata.arcgis.com')
60
+ # client.dataset_show('c92b122901ad40ee897d36b1a21f3187_11', fields: { datasets: 'title,url,description,thumbnail'})
35
61
  # @return [Object] Faraday::Response object
36
62
  def dataset_show(id, params = {})
37
63
  raise '#dataset_show must receive a dataset id' if id.nil?
@@ -41,6 +67,10 @@ module Opendata
41
67
  # Returns the url based on the id and url parameters specified
42
68
  # @param id [String] The dataset id
43
69
  # @param params [Hash] Additional request parameters
70
+ # @example Get the requets url for retrieving a single dataset and its related organizations and sites
71
+ # client = Opendata.new('https://opendata.arcgis.com')
72
+ # client.dataset_show_url('c92b122901ad40ee897d36b1a21f3187_11', include: 'organizations,sites')
73
+ # #=> "/api/v2/datasets/c92b122901ad40ee897d36b1a21f3187_11?include=organizations%2Csites"
44
74
  # @return [String] request url based on id and parameters specified
45
75
  def dataset_show_url(id, params = {})
46
76
  DATASETS_API_PATH + "/#{id}" + param_to_query_string(params)
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Opendata
2
- VERSION = '0.0.6.1'.freeze
2
+ VERSION = '0.0.6.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arcgis-opendata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6.1
4
+ version: 0.0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Harris