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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c52e8316f3c509f3ae0a791323c598e798c8933880f928d2cc3db3bcc84a2939
4
- data.tar.gz: 6e4ad46da7861b9d3593e28edbced9c5f0f9e6cbb409d423948fea22a97d3a52
3
+ metadata.gz: 7201e59e689e176de3bffc5ad545cc38d733207c694d82f96c4049ef1f67ccf7
4
+ data.tar.gz: 225707c75a0e9e7ef174ab1ec613e1924844442e04c7351810a23b53b18ef09a
5
5
  SHA512:
6
- metadata.gz: 63cc402c1efbb81509879daec8e2207993137e654a825b8e03a3e3b71149196daa5b9c9f9f8db0eeacb110b4d2c223478a05c7487c3a162a31fc95a83d041978
7
- data.tar.gz: 123c76073093afe99055f1e3593aef91f1f1c8b90a5763b566d82d46a09e27523d6c0b262efdbdedb742d4c06821cf72052160d3c7c74c14652eea5d96c99f1a
6
+ metadata.gz: 6fcd1023643233fed3b89974cb098c6ca381c4f85a3d17f81a5d1dbdeb48d2c8a2dd8aa6facd60f961317a775b446cdd30946ff2715497f2eee5892cf6b7a9c0
7
+ data.tar.gz: 4c2342ce7c817b4bce59455f35738887d86a1c3ac8eb5ad5738a12a6726c9d4c6968d57b46709b2cafd46f16e9a2fb56658c5ebf311fa3abdc3ca3720b8bd84c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # Version : 1.0.1
2
+
3
+ fix: metadata
4
+
1
5
  # Version : 1.0.0
2
6
 
3
7
  version 1.0.0
@@ -0,0 +1,12 @@
1
+ # Version : 1.0.1
2
+
3
+ fix: metadata
4
+
5
+ ## commits
6
+
7
+ * patch version up
8
+ * patch version
9
+ * fix: metadata
10
+ * fix: README
11
+ * fix: README
12
+ * fix: description
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- getto-params (1.0.0)
4
+ getto-params (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -27,4 +27,4 @@ DEPENDENCIES
27
27
  simplecov (~> 0.16)
28
28
 
29
29
  BUNDLED WITH
30
- 1.16.2
30
+ 1.16.6
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.
@@ -1,5 +1,5 @@
1
1
  module Getto
2
2
  class Params
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
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.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-27 00:00:00.000000000 Z
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: {}