We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'd love to be able to use other input values in the Proc form for default:
Proc
input :foo, type: [String], allow_nil: false input :bar, type: [String], default: ->(inputs) { "Default Bar: #{inputs[:foo]}" }
You probably don't want the Proc to be able to modify inputs, so we should pass a defensive copy:
inputs
def default_for_normal_mode_with(result, key, default) if default.is_a?(Proc) args = [] args.push(result.dup) if default.arity != 0 default = default.call(*args) end result[key] = default end
If you're interested in this, I'm happy to open a pull request.
The text was updated successfully, but these errors were encountered:
Oh, that could be interesting! Please go for it 👍🏻
Good thinking about the fact that we should be defensive to disallow copies during checks 👏🏻
Sorry, something went wrong.
Hi @jamesarosen, would you have some time to open a PR for this?
Yes, but it's going to be a week or two before I do.
Sounds good to me :)
Successfully merging a pull request may close this issue.
I'd love to be able to use other input values in the
Proc
form for default:You probably don't want the
Proc
to be able to modifyinputs
, so we should pass a defensive copy:If you're interested in this, I'm happy to open a pull request.
The text was updated successfully, but these errors were encountered: