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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c00614f5de71894e2e1f941957a2503a20c17690edcc21fcee175817d82d69f7
4
- data.tar.gz: b0ebfbbc567c0407a1b623ea7aae5bad1101bfa9f272479d50898b1db18405c5
3
+ metadata.gz: a79a7c355d8200cfccab7fdb7fbd01f37a74ee82a555de9a4697a6800616d2e4
4
+ data.tar.gz: 647315d7446816af5ce68035edcbedf32593a89aad70c511632f8ce3abe652c5
5
5
  SHA512:
6
- metadata.gz: e9fcf7f50cc2aaaa811ae5827a451bb85d584e22d04ec9a69da66467a1ebf46119c2271e699d81df6cff6d6da351fa7e1ea0e456105410763de77ab398bbcde9
7
- data.tar.gz: d01338e51d75a155e942c22664720ac778156a44a81c7f565aa7ff8515d4119dbe21b8f24012566ec6e2d543f89ba0c72720a918bc184e84954623ba043f7dd7
6
+ metadata.gz: e31f31134b22d04612fdc5ef4f303cbfe2f25a1da5b9e0b2784b0fc3415daa8b876afba041f1747dd407dbab0cf57ca29e0a7350c6dfb0c0c0215b1fca655816
7
+ data.tar.gz: 28828344996f33389508a8664939a18fd3f182800dfe81bb3bf14d7b68864ecaa56d94698d73c93df6592af98be7f631d896aaf648b9d10b730fa9f3eb864fc5
@@ -15,7 +15,7 @@ jobs:
15
15
  runs-on: ubuntu-latest
16
16
  strategy:
17
17
  matrix:
18
- ruby: [ '2.5', '2.6', '2.7' ]
18
+ ruby: [ '2.5', '2.6', '2.7', '3.0' ]
19
19
  name: Ruby ${{ matrix.ruby }} spec
20
20
  steps:
21
21
  - uses: actions/checkout@v2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- met_museum (1.3.8)
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.1)
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
- options = default_search_options.merge(args)
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 = options[:limit].to_i
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
@@ -1,3 +1,3 @@
1
1
  module MetMuseum
2
- VERSION = "1.3.8".freeze
2
+ VERSION = "1.4.0".freeze
3
3
  end
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.3.8
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-19 00:00:00.000000000 Z
11
+ date: 2020-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler