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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b54579906b5351c77e42e6d13b61202a320224efb455db82d2a1b1df87c1a9c
4
- data.tar.gz: f3fa877d10818556ee873f7b90d0f8fbaf14f15783211f1dbcfde919ec7e8f31
3
+ metadata.gz: 41fbfe7278e246d0aac3dd7b43f3deb1cf10301cdacb439f6d21568e462ad185
4
+ data.tar.gz: bbc69107b0773c9d1ce2715f9560bde4c123797370d071401640fa112aa36f27
5
5
  SHA512:
6
- metadata.gz: b75dfea217c60818deee6e0ca0a4d8fb6aea539291903d9aebe888d87cf2cd3f8f7e2676b4df3bb8c1640c10e1f3767f9b2ca5839aed248040bbb6a5d504f91a
7
- data.tar.gz: 121728e46d52c0ed63243779298aed1d510f09cfc2f8feb15cda092f5be858b1542fbc3d4bef41270de13db7ca718069cbb9123316689d2daacfb49085503d6f
6
+ metadata.gz: b4d15f8e18878c8b583fc8e9e4da9bc5362160b428137d67f105d9df593fb1fb8baa3b1521aecc21267b92a216bf723f90f5eeecf939b2b2a9a0ff3a0afe2e7d
7
+ data.tar.gz: 9af74777e7d5c9d43214c7708f49d06f124e5d7c0032caaadf2ffda80f98aeaf4ce233bc55cc4c0515cb301a9ab936ff9f7f765638bf73ab440307c92e792ae5
@@ -1,3 +1,3 @@
1
1
  module SmartParams
2
- VERSION = "2.0.8"
2
+ VERSION = "2.1.0"
3
3
  end
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.8
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-05-19 00:00:00.000000000 Z
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: '5.1'
97
- - !ruby/object:Gem::Dependency
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: '0.4'
104
- type: :runtime
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: '0.4'
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