smart_params 2.0.8 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smart_params/version.rb +1 -1
- data/lib/smart_params.rb +12 -0
- metadata +21 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41fbfe7278e246d0aac3dd7b43f3deb1cf10301cdacb439f6d21568e462ad185
|
4
|
+
data.tar.gz: bbc69107b0773c9d1ce2715f9560bde4c123797370d071401640fa112aa36f27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4d15f8e18878c8b583fc8e9e4da9bc5362160b428137d67f105d9df593fb1fb8baa3b1521aecc21267b92a216bf723f90f5eeecf939b2b2a9a0ff3a0afe2e7d
|
7
|
+
data.tar.gz: 9af74777e7d5c9d43214c7708f49d06f124e5d7c0032caaadf2ffda80f98aeaf4ce233bc55cc4c0515cb301a9ab936ff9f7f765638bf73ab440307c92e792ae5
|
data/lib/smart_params/version.rb
CHANGED
data/lib/smart_params.rb
CHANGED
@@ -47,6 +47,18 @@ module SmartParams
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
def fetch(key, default = KeyError)
|
51
|
+
if default == KeyError
|
52
|
+
as_json.fetch(key, default)
|
53
|
+
else
|
54
|
+
as_json.fetch(key)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def dig(*keys)
|
59
|
+
as_json.dig(*keys)
|
60
|
+
end
|
61
|
+
|
50
62
|
def method_missing(name, *arguments, &block)
|
51
63
|
if payload.respond_to?(name)
|
52
64
|
payload.public_send(name)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_params
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kurtis Rainbolt-Greene
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,30 +84,34 @@ dependencies:
|
|
84
84
|
name: activesupport
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 4.0.0
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '4.1'
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 5.0.0
|
96
|
+
- - ">="
|
88
97
|
- !ruby/object:Gem::Version
|
89
98
|
version: '5.1'
|
90
99
|
type: :runtime
|
91
100
|
prerelease: false
|
92
101
|
version_requirements: !ruby/object:Gem::Requirement
|
93
102
|
requirements:
|
94
|
-
- - "
|
103
|
+
- - ">="
|
95
104
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
97
|
-
-
|
98
|
-
name: dry-monads
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
105
|
+
version: 4.0.0
|
106
|
+
- - ">="
|
102
107
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
104
|
-
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
108
|
+
version: '4.1'
|
109
|
+
- - ">="
|
109
110
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
111
|
+
version: 5.0.0
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '5.1'
|
111
115
|
- !ruby/object:Gem::Dependency
|
112
116
|
name: dry-types
|
113
117
|
requirement: !ruby/object:Gem::Requirement
|