sinatra-dry_param 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sinatra/dry_param.rb +2 -2
- data/lib/sinatra/dry_param/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: 04c4933ac1f0430fda899663f6532f73d8b6414814f5041f2ac1e98d2fc6634e
|
4
|
+
data.tar.gz: 6c9e5ae81e798c82b33d68692c46119f2445ac85e4aea7f99f433b708302d27c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66efeb17966aa02d875585395ac6793fb88aef95908c3806679e62462a5586bdff7ccd4185d3221c594687ae53f023ee5e497a6d26da00e985aff6a2607a163c
|
7
|
+
data.tar.gz: '092e33532074729dfeecafcb1ad449a4b97a2e3919dae2673a50808b806e4d9d064eff48f287bb03fbd2adc36d6c696f1016a6aa3eb5608451d9192ae0b7e261'
|
data/lib/sinatra/dry_param.rb
CHANGED
@@ -16,7 +16,7 @@ module Sinatra
|
|
16
16
|
|
17
17
|
module Helpers
|
18
18
|
def validate_params(name = :dry, prs = params)
|
19
|
-
result = settings.send("#{name}
|
19
|
+
result = settings.send("#{name}_param_schema").call(prs)
|
20
20
|
if result.success?
|
21
21
|
result.to_h
|
22
22
|
else
|
@@ -29,7 +29,7 @@ module Sinatra
|
|
29
29
|
|
30
30
|
def params(name = :dry, schema: nil, &block)
|
31
31
|
schema ||= Dry::Schema.Params(&block)
|
32
|
-
set "#{name}
|
32
|
+
set "#{name}_param_schema", schema
|
33
33
|
end
|
34
34
|
|
35
35
|
def self.registered(app)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-dry_param
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Viet (Drake) Tran
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-schema
|