lib/abstractivator/proc_ext.rb in abstractivator-0.14.0 vs lib/abstractivator/proc_ext.rb in abstractivator-0.15.0
- old
+ new
@@ -95,10 +95,10 @@
info.req_arity = params.count { |p| p.first == :req }
info.total_arity = info.req_arity + params.count { |p| p.first == :opt }
info.accepts_arg_splat = params.any? { |p| p.first == :rest }
accepts_kw_splat = params.any? { |p| p.first == :keyrest }
has_kw_args = params.any? { |(type, name)| (type == :key || type == :keyreq) && !name.nil? }
- info.requires_kw_customization = has_kw_args && !accepts_kw_splat
+ info.requires_kw_customization = (has_kw_args || kws.any?) && !accepts_kw_splat
if info.requires_kw_customization
opt_key_names = info.params.select { |(type, name)| type == :key && !name.nil? }.map(&:value)
req_key_names = info.params.select { |(type, name)| type == :keyreq && !name.nil? }.map(&:value)
info.all_key_names = opt_key_names + req_key_names
info.kw_padding = req_key_names.hash_map { nil }