5 ms·
Is it to spare keystrokes in method definition, or rather, in method invocation? Your second definition reads that `with_longer_parameters` is a keyword argume
by cpb 5y ago
Is it to spare keystrokes in method definition, or rather, in method invocation?
Your second definition reads that `with_longer_parameters` is a keyword argument with no default.
Still, you've illustrated the keystroke savings with your choice of parameter names :-)
- kule 5y agoYeah, should be invocation, there's a nice example on the feature request (https://bugs.ruby-lang.org/issues/14579 https://bugs.ruby-lang.org/issues/14579): def login(username: ENV["USER"], password:) p(username:, password:) end login(password: "xxx") #=> {:username=>"shugo", :password=>"xxx"}