met_museum 1.3.8 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +1 -1
- data/Gemfile.lock +4 -2
- data/lib/met_museum/collection.rb +3 -33
- 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: a79a7c355d8200cfccab7fdb7fbd01f37a74ee82a555de9a4697a6800616d2e4
|
4
|
+
data.tar.gz: 647315d7446816af5ce68035edcbedf32593a89aad70c511632f8ce3abe652c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e31f31134b22d04612fdc5ef4f303cbfe2f25a1da5b9e0b2784b0fc3415daa8b876afba041f1747dd407dbab0cf57ca29e0a7350c6dfb0c0c0215b1fca655816
|
7
|
+
data.tar.gz: 28828344996f33389508a8664939a18fd3f182800dfe81bb3bf14d7b68864ecaa56d94698d73c93df6592af98be7f631d896aaf648b9d10b730fa9f3eb864fc5
|
data/.github/workflows/ruby.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
met_museum (1.
|
4
|
+
met_museum (1.4.0)
|
5
5
|
faraday
|
6
6
|
oj
|
7
7
|
|
@@ -11,8 +11,9 @@ GEM
|
|
11
11
|
ast (2.4.1)
|
12
12
|
coderay (1.1.2)
|
13
13
|
diff-lcs (1.3)
|
14
|
-
faraday (1.0
|
14
|
+
faraday (1.2.0)
|
15
15
|
multipart-post (>= 1.2, < 3)
|
16
|
+
ruby2_keywords
|
16
17
|
method_source (0.9.2)
|
17
18
|
multipart-post (2.1.1)
|
18
19
|
oj (3.10.6)
|
@@ -53,6 +54,7 @@ GEM
|
|
53
54
|
rubocop-ast (0.1.0)
|
54
55
|
parser (>= 2.7.0.1)
|
55
56
|
ruby-progressbar (1.10.1)
|
57
|
+
ruby2_keywords (0.0.2)
|
56
58
|
unicode-display_width (1.7.0)
|
57
59
|
|
58
60
|
PLATFORMS
|
@@ -101,23 +101,10 @@ module MetMuseum
|
|
101
101
|
# @return [Array<Integer>] objectIDs An array containing the object ID of publicly-available object
|
102
102
|
# @return [Array<Object>] objects An array containing the objects that contain the search query within the object’s data
|
103
103
|
def search(query, **args)
|
104
|
-
|
105
|
-
response = new_faraday(API_ENDPOINT, SEARCH_URI,
|
106
|
-
q: query,
|
107
|
-
isHighlight: options[:isHighlight],
|
108
|
-
title: options[:title],
|
109
|
-
tags: options[:tags],
|
110
|
-
departmentId: options[:departmentId],
|
111
|
-
isOnView: options[:isOnView],
|
112
|
-
artistOrCulture: options[:artistOrCulture],
|
113
|
-
medium: options[:medium]&.multi_option,
|
114
|
-
hasImages: options[:hasImages],
|
115
|
-
geoLocation: options[:geoLocation]&.multi_option,
|
116
|
-
dateBegin: options[:dateBegin],
|
117
|
-
dateEnd: options[:dateEnd]
|
118
|
-
})
|
104
|
+
args.merge!({q: query})
|
105
|
+
response = new_faraday(API_ENDPOINT, SEARCH_URI, args)
|
119
106
|
origin_response = return_response(response)
|
120
|
-
limit =
|
107
|
+
limit = args[:limit].to_i
|
121
108
|
return origin_response if limit <= 0
|
122
109
|
|
123
110
|
origin_response["objectIDs"][0..limit - 1].map { |id| MetMuseum::Collection.new.object(id) }
|
@@ -152,22 +139,5 @@ module MetMuseum
|
|
152
139
|
|
153
140
|
raise TypeError, "Write String or Array type"
|
154
141
|
end
|
155
|
-
|
156
|
-
def default_search_options
|
157
|
-
{
|
158
|
-
limit: 0,
|
159
|
-
isHighlight: false,
|
160
|
-
title: true,
|
161
|
-
tags: true,
|
162
|
-
departmentId: nil,
|
163
|
-
isOnView: nil,
|
164
|
-
artistOrCulture: nil,
|
165
|
-
medium: nil,
|
166
|
-
hasImages: nil,
|
167
|
-
geoLocation: nil,
|
168
|
-
dateBegin: 0,
|
169
|
-
dateEnd: 2000
|
170
|
-
}
|
171
|
-
end
|
172
142
|
end
|
173
143
|
end
|
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.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hyuraku
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|