General

Profile

Lithium (Brad Krane)

  • Login: Lithium
  • Registered on: 04/16/2021
  • Last sign in: 04/16/2021

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 1 0 1

Activity

04/17/2021

11:43 PM Ruby Feature #17808: Feature Request: JS like splat of Object properties as named method parameters

> But ultimately your whole feature request rely on a very specific JS "feature" (many people would call it a cruft), that extra arguments are simply ignored.
Yes likely but it is very convenient.
> ...
I agree with you here. I suppo...
Lithium (Brad Krane)

04/16/2021

07:24 PM Ruby Feature #17808: Feature Request: JS like splat of Object properties as named method parameters
byroot (Jean Boussier) wrote in #note-3:
> Well, the ruby equivalent to your example JS function would be:
> ...
This does work, but this requires modifying all methods to include this extra parameter to avoid the error.
Is there a way...
Lithium (Brad Krane)
06:53 PM Ruby Feature #17808: Feature Request: JS like splat of Object properties as named method parameters
Thanks for the quick update.
That almost works but to automate this the to_hash function needs to be aware of the methods named arguments. The below works in one case and fails in another with an object having more instance variables t...
Lithium (Brad Krane)
12:18 PM Ruby Feature #17808 (Open): Feature Request: JS like splat of Object properties as named method parameters
I'm pretty sure there is no equivalent Ruby for a very convenient JS way to enter named function parameters as below:
``` javascript
const test = ({param1,
param2,
param3 = null,
param4 = false,
param5 = null,
}={}) => {
...
Lithium (Brad Krane)

Also available in: Atom