Closed
Description
What I'd like to do:
params do
requires :foo
optional :bar, default: -> (other_params) { "bar from foo #{other_params[:foo]} }
end
or perhaps
params do
requires :foo
optional :bar, coerce: -> (bar_value, other_params) { "bar from foo #{other_params[:foo]} }
end
Unfortunately, neither default
nor coerce
seems to accept the other params as an argument. It may be possible to get them from self
(which is a ParamsScope
) within that block, but it's not obvious how.