typed-parameter 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -3
- data/lib/typed_parameter/base.rb +1 -1
- data/lib/typed_parameter/version.rb +1 -1
- data/typed_parameter.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69e551b7c699d91a3f6a1f20616c32c3802027db6980b626a4b3ec01edda5eb0
|
4
|
+
data.tar.gz: 4650c2a5e68b02fc70b3c6718658a014e8de13f33466f9c7d1b9ebf627a013b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1a3fe4f14f1832ab4aaf757fd10b943d01d277e071e11592d6294af55183a23564cb1289e07b5033d218c7908864ef8158fea7153e423c97486da73038f31e9
|
7
|
+
data.tar.gz: 3f53cc4a56b7c26820205df4f6d4287b8086037d64db9c6e17f04246a01d893dd36ee56be8d327490fb1b1c2af882cf7c249f84c8c67f4bd3764b56d4aac5bfe
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# typed_parameter
|
2
|
-
Create typed parameter class using strong
|
2
|
+
Create typed parameter class using strong parameter in rails.
|
3
3
|
You can cleanup parameter code for permit in your controller and convert it to the type you want.
|
4
|
+
You can get your OpenAPI JSON for parameter schemas.
|
5
|
+
|
4
6
|
## Installation
|
5
7
|
|
6
8
|
Add this line to your application's Gemfile:
|
@@ -22,7 +24,7 @@ Or install it yourself as:
|
|
22
24
|
Example 1. Type convert
|
23
25
|
-----
|
24
26
|
~~~ruby
|
25
|
-
class UserCreateParams <
|
27
|
+
class UserCreateParams < TypedParameter::Base
|
26
28
|
field :name, String
|
27
29
|
field :age, Integer
|
28
30
|
field :email, String
|
@@ -271,5 +273,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
271
273
|
|
272
274
|
## Contributing
|
273
275
|
|
274
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
276
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/tranquilthink/typed-parameter.
|
275
277
|
|
data/lib/typed_parameter/base.rb
CHANGED
@@ -25,7 +25,7 @@ module TypedParameter
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def permit(params)
|
28
|
-
raise Error::
|
28
|
+
raise Error, "params class must be ActionController::Parameters" unless params.class <= ActionController::Parameters
|
29
29
|
|
30
30
|
use_constraints(params).permit!
|
31
31
|
end
|
data/typed_parameter.gemspec
CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |spec|
|
|
4
4
|
spec.name = 'typed-parameter'
|
5
5
|
spec.version = TypedParameter::VERSION
|
6
6
|
spec.authors = ['Minwoo Jo']
|
7
|
-
spec.email = ['tranquilthink@
|
7
|
+
spec.email = ['tranquilthink@gmail.com']
|
8
8
|
spec.summary = 'Typed Paramter For Rails'
|
9
9
|
spec.description = 'Create typed parameter class using strong paramter in rails'
|
10
10
|
spec.homepage = 'https://github.com/tranquilthink/typed-parameter'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typed-parameter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Minwoo Jo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
version: '0'
|
41
41
|
description: Create typed parameter class using strong paramter in rails
|
42
42
|
email:
|
43
|
-
- tranquilthink@
|
43
|
+
- tranquilthink@gmail.com
|
44
44
|
executables: []
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|