getto-params 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/CHANGELOG/1.0.1.md +12 -0
- data/Gemfile.lock +2 -2
- data/README.md +36 -0
- data/getto-params.gemspec +2 -2
- data/lib/getto/params/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7201e59e689e176de3bffc5ad545cc38d733207c694d82f96c4049ef1f67ccf7
|
4
|
+
data.tar.gz: 225707c75a0e9e7ef174ab1ec613e1924844442e04c7351810a23b53b18ef09a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fcd1023643233fed3b89974cb098c6ca381c4f85a3d17f81a5d1dbdeb48d2c8a2dd8aa6facd60f961317a775b446cdd30946ff2715497f2eee5892cf6b7a9c0
|
7
|
+
data.tar.gz: 4c2342ce7c817b4bce59455f35738887d86a1c3ac8eb5ad5738a12a6726c9d4c6968d57b46709b2cafd46f16e9a2fb56658c5ebf311fa3abdc3ca3720b8bd84c
|
data/CHANGELOG.md
CHANGED
data/CHANGELOG/1.0.1.md
ADDED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -48,6 +48,7 @@ Getto::Params::Search.new(
|
|
48
48
|
sort: "name.asc",
|
49
49
|
query: {
|
50
50
|
"name.cont" => "search",
|
51
|
+
"value.eq" => "value1",
|
51
52
|
},
|
52
53
|
).to_h do |search|
|
53
54
|
search.sort do |s|
|
@@ -55,6 +56,7 @@ Getto::Params::Search.new(
|
|
55
56
|
end
|
56
57
|
search.query do |q|
|
57
58
|
q.search "name.cont", &q.not_empty
|
59
|
+
q.search("name.cont"){|val| ["value1","value2"].include? val }
|
58
60
|
end
|
59
61
|
end
|
60
62
|
# => {
|
@@ -66,6 +68,7 @@ end
|
|
66
68
|
# },
|
67
69
|
# query: {
|
68
70
|
# "name.cont": "search",
|
71
|
+
# "value.eq": "value1",
|
69
72
|
# },
|
70
73
|
# }
|
71
74
|
```
|
@@ -194,6 +197,22 @@ Getto::Params::Search.new(
|
|
194
197
|
end
|
195
198
|
```
|
196
199
|
|
200
|
+
#### pages
|
201
|
+
|
202
|
+
```ruby
|
203
|
+
# page: 1, limit: 1000
|
204
|
+
# => {
|
205
|
+
# limit: 1000,
|
206
|
+
# offset: 0,
|
207
|
+
# }
|
208
|
+
|
209
|
+
# page: 2, limit: 1000
|
210
|
+
# => {
|
211
|
+
# limit: 1000,
|
212
|
+
# offset: 1000,
|
213
|
+
# }
|
214
|
+
```
|
215
|
+
|
197
216
|
#### sort order
|
198
217
|
|
199
218
|
- straight order
|
@@ -274,6 +293,23 @@ end
|
|
274
293
|
# }
|
275
294
|
```
|
276
295
|
|
296
|
+
- check by block
|
297
|
+
|
298
|
+
```ruby
|
299
|
+
search.query do |q|
|
300
|
+
q.search("value.eq"){|val| ["value1","value2"].include? val }
|
301
|
+
end
|
302
|
+
|
303
|
+
# query: { "value.eq" => "value3" }
|
304
|
+
# => query: {
|
305
|
+
# }
|
306
|
+
|
307
|
+
# query: { "value.eq" => "value1" }
|
308
|
+
# => query: {
|
309
|
+
# "value.eq": "value1",
|
310
|
+
# }
|
311
|
+
```
|
312
|
+
|
277
313
|
|
278
314
|
## Install
|
279
315
|
|
data/getto-params.gemspec
CHANGED
@@ -11,8 +11,8 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.email = ["shun@getto.systems"]
|
12
12
|
|
13
13
|
spec.summary = %q{validation and format params}
|
14
|
-
spec.description = %q{Validate parameters like strong-parameters(rails)}
|
15
|
-
spec.homepage = "https://github.com/getto-systems/getto-params"
|
14
|
+
spec.description = %q{Validate parameters like strong-parameters(rails), and parameter formatter for search api}
|
15
|
+
spec.homepage = "https://github.com/getto-systems/rubygems-getto-params"
|
16
16
|
spec.license = "MIT"
|
17
17
|
|
18
18
|
# Specify which files should be added to the gem when it is released.
|
data/lib/getto/params/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: getto-params
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shun@getto.systems
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,7 +66,8 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.16'
|
69
|
-
description: Validate parameters like strong-parameters(rails)
|
69
|
+
description: Validate parameters like strong-parameters(rails), and parameter formatter
|
70
|
+
for search api
|
70
71
|
email:
|
71
72
|
- shun@getto.systems
|
72
73
|
executables: []
|
@@ -85,6 +86,7 @@ files:
|
|
85
86
|
- CHANGELOG/0.3.0.md
|
86
87
|
- CHANGELOG/0.4.0.md
|
87
88
|
- CHANGELOG/1.0.0.md
|
89
|
+
- CHANGELOG/1.0.1.md
|
88
90
|
- Gemfile
|
89
91
|
- Gemfile.lock
|
90
92
|
- LICENSE
|
@@ -94,7 +96,7 @@ files:
|
|
94
96
|
- lib/getto/params.rb
|
95
97
|
- lib/getto/params/search.rb
|
96
98
|
- lib/getto/params/version.rb
|
97
|
-
homepage: https://github.com/getto-systems/getto-params
|
99
|
+
homepage: https://github.com/getto-systems/rubygems-getto-params
|
98
100
|
licenses:
|
99
101
|
- MIT
|
100
102
|
metadata: {}
|