hanami-view 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/hanami/view/exposure.rb +11 -3
- data/lib/hanami/view/version.rb +1 -1
- data/lib/hanami/view.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6622b0b75e291a41cce8f7a9d41c41f22aef610a6ee1a3f87516d2c973c24f5e
|
|
4
|
+
data.tar.gz: 729928db32dee73dd372a220672ef1f447643f0661044079956492b892a04d51
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d422fca15d310702492a735112ade9f711ee18a0a8b578d358ad76e5bb252374ab64056842d8af42842a4e1c5804a8ef2ac5e5416333ca56fa54193e6a11fa2
|
|
7
|
+
data.tar.gz: d84007072de7c1b2d47bd3d1fcfcd5076e9f9c66f7ea3111d4f3679003626d26a0dc6bf6774a4891691bbd77080f58ab157caa26d9cba91a920cb50a1555ed6f
|
data/CHANGELOG.md
CHANGED
data/lib/hanami/view/exposure.rb
CHANGED
|
@@ -12,7 +12,7 @@ module Hanami
|
|
|
12
12
|
include Dry::Equalizer(:name, :proc, :object, :options)
|
|
13
13
|
|
|
14
14
|
EXPOSURE_DEPENDENCY_PARAMETER_TYPES = %i[req opt].freeze
|
|
15
|
-
|
|
15
|
+
KEYWORD_INPUT_PARAMETER_TYPES = %i[key keyreq].freeze
|
|
16
16
|
|
|
17
17
|
# @api private
|
|
18
18
|
# @since 2.1.0
|
|
@@ -70,7 +70,7 @@ module Hanami
|
|
|
70
70
|
@input_keys ||=
|
|
71
71
|
if proc
|
|
72
72
|
proc.parameters.each_with_object([]) { |(type, name), keys|
|
|
73
|
-
keys << name if
|
|
73
|
+
keys << name if KEYWORD_INPUT_PARAMETER_TYPES.include?(type)
|
|
74
74
|
}
|
|
75
75
|
else
|
|
76
76
|
[]
|
|
@@ -147,9 +147,17 @@ module Hanami
|
|
|
147
147
|
end
|
|
148
148
|
|
|
149
149
|
def proc_input_args(input)
|
|
150
|
-
|
|
150
|
+
args = {}
|
|
151
|
+
|
|
152
|
+
if proc.parameters.any? { |(type, _name)| type == :keyrest }
|
|
153
|
+
args.merge! input.except(:context)
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
input_keys.each { |key|
|
|
151
157
|
args[key] = input[key] if input.key?(key)
|
|
152
158
|
}
|
|
159
|
+
|
|
160
|
+
args
|
|
153
161
|
end
|
|
154
162
|
|
|
155
163
|
def prepare_proc(proc, object)
|
data/lib/hanami/view/version.rb
CHANGED
data/lib/hanami/view.rb
CHANGED
|
@@ -342,7 +342,7 @@ module Hanami
|
|
|
342
342
|
# default values for these parameters to make the corresponding input
|
|
343
343
|
# keys optional
|
|
344
344
|
# - To receive the Context object, provide a `context:` keyword parameter
|
|
345
|
-
# - To receive the view's input arguments in their
|
|
345
|
+
# - To receive the view's input arguments in their entirety, provide a
|
|
346
346
|
# keywords splat parameter (i.e. `**input`)
|
|
347
347
|
#
|
|
348
348
|
# @example Accessing input arguments
|