Skip to content

Commit 436272a

Browse files
committed
no more annoying messages when using Proc type params
1 parent 1492473 commit 436272a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ruby/hyper-component/lib/hyperstack/internal/component/class_methods.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ def param(*args)
9393
name = args[0]
9494
options = args[1] || {}
9595
end
96+
if options[:type] == Proc
97+
options[:default] ||= nil
98+
options[:allow_nil] = true unless options.key?(:allow_nil)
99+
end
96100
if options[:default]
97101
validator.optional(name, options)
98102
else

0 commit comments

Comments
 (0)