There is this code:
a = -> (var:) { "Var: #{var}" }
It works successfully when used like this:
a.call(var: "Hi!")
But how can I pass arguments to .call that might not be used?
a.call(var: "Hi!", extra: "")
ArgumentError (unknown keyword: :extra)
For example, I want to decide in different places whether I need to use certain variables in texts.
I have a root location where all named arguments are always passed to .call. And I need to pass lambda in other places, where only the necessary arguments are described.