met_museum 1.2.1 → 1.3.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +23 -24
- data/lib/met_museum/collection.rb +12 -2
- data/lib/met_museum/endpoint.rb +1 -0
- data/lib/met_museum/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94ea790efb01c63a733aac63c10e2ec0f241d99d3a73a76bccaccca915ec2dbe
|
4
|
+
data.tar.gz: 2b2fcbbbc15a75ddd725b0dab4e51410467e3556498d7371836de92e94ac7fe1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 436da70bddff5aa4773e93900e44b981f2bed267630418061a6becb6bab410ed1c5e3baa31571ad46af4417022c9346f5219e7cf9fc43372757610efea5801d9
|
7
|
+
data.tar.gz: 5952a9255c9f17f803d4a53745bddbfef654e302b51bb7087efeaedce4270e9ad6248574635381703f06e31bd5bb3d2517b90a0be1ebd06dc6d118687ca4b8e0
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -39,28 +39,17 @@ MetMuseum::Collection.objects
|
|
39
39
|
```rb
|
40
40
|
collection = MetMuseum::Collection.new()
|
41
41
|
collection.objects
|
42
|
-
=> {"total"=>
|
42
|
+
=> {"total"=>494788,
|
43
43
|
"objectIDs"=>
|
44
44
|
[1,
|
45
45
|
2,
|
46
46
|
3,
|
47
47
|
4,
|
48
48
|
--< omit >--
|
49
|
-
|
50
|
-
|
51
|
-
collection.objects('2018-10-10')
|
52
|
-
=>{"total"=>88232,
|
53
|
-
"objectIDs"=>
|
54
|
-
[33,
|
55
|
-
35,
|
56
|
-
36,
|
57
|
-
74,
|
58
|
-
75,
|
59
|
-
--< omit >--
|
60
|
-
820613]}
|
49
|
+
826602]}
|
61
50
|
|
62
51
|
collection.objects(Date.new(2018,10,10))
|
63
|
-
=>{"total"=>
|
52
|
+
=>{"total"=>355400,
|
64
53
|
"objectIDs"=>
|
65
54
|
[33,
|
66
55
|
35,
|
@@ -68,18 +57,28 @@ collection.objects('2018-10-10')
|
|
68
57
|
74,
|
69
58
|
75,
|
70
59
|
--< omit >--
|
71
|
-
|
60
|
+
826307]}
|
72
61
|
|
73
|
-
collection.objects(
|
74
|
-
=>{"total"=>
|
62
|
+
collection.objects(nil,1)
|
63
|
+
=> {"total"=>18572,
|
75
64
|
"objectIDs"=>
|
76
|
-
[
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
65
|
+
[1,
|
66
|
+
2,
|
67
|
+
3,
|
68
|
+
4,
|
69
|
+
--< omit >--
|
70
|
+
821352]}
|
71
|
+
|
72
|
+
collection.objects(Date.new(2018,10,10),1)
|
73
|
+
=> {"total"=>15439,
|
74
|
+
"objectIDs"=>
|
75
|
+
[7,
|
76
|
+
8,
|
77
|
+
33,
|
78
|
+
34,
|
79
|
+
--< omit >--
|
80
|
+
816271]}
|
81
|
+
|
83
82
|
```
|
84
83
|
</div>
|
85
84
|
</details>
|
@@ -6,11 +6,12 @@ module MetMuseum
|
|
6
6
|
class Collection
|
7
7
|
# Return a listing of all valid Object IDs available to use
|
8
8
|
# @param [Date] metadataDate Returns any objects with updated data after this date
|
9
|
+
# @params [Integer] departmentIds Returns any objects in a specific department
|
9
10
|
# @return [Hash<total, Integer>] The total number of publicly-available objects
|
10
11
|
# @return [Hash<objectIDs, Array<Integer>>] An array containing the object ID of publicly-available object
|
11
|
-
def objects(metadataDate = nil)
|
12
|
+
def objects(metadataDate = nil, departmentIds = nil)
|
12
13
|
metadataDate = check_date(metadataDate) unless metadataDate.nil?
|
13
|
-
response = Faraday.new(:url => API_ENDPOINT).get PUBLIC_URI, {:metadataDate => metadataDate}
|
14
|
+
response = Faraday.new(:url => API_ENDPOINT).get PUBLIC_URI, {:metadataDate => metadataDate, :departmentIds => departmentIds}
|
14
15
|
return_response(response)
|
15
16
|
end
|
16
17
|
|
@@ -71,6 +72,15 @@ module MetMuseum
|
|
71
72
|
return_response(response)
|
72
73
|
end
|
73
74
|
|
75
|
+
# returns a listing of all departments
|
76
|
+
# @return [Array] departments An array containing the JSON objects that contain each department's departmentId and display name. The departmentId is to be used as a query parameter on the `/objects` endpoint
|
77
|
+
# @return [Integer] departments Department ID as an integer. The departmentId is to be used as a query parameter on the `/objects` endpoint
|
78
|
+
# @return [String] departments Display name for a department
|
79
|
+
def department
|
80
|
+
response = Faraday.get "#{API_ENDPOINT}#{DEPARTMENTS_URI}"
|
81
|
+
return_response(response)
|
82
|
+
end
|
83
|
+
|
74
84
|
# returns a listing of all Object IDs for objects that contain the search query within the object’s data
|
75
85
|
# @param [String] query search term e.g. sunflowers
|
76
86
|
# @param [Interger] limit number of objects zthat contain the search query within the object’s data
|
data/lib/met_museum/endpoint.rb
CHANGED
data/lib/met_museum/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: met_museum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hyuraku
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|