barsoom / attr_extras

Takes some boilerplate out of Ruby with methods like attr_initialize.
MIT License
560 stars 31 forks source link

Default values for non-keyword arguments #32

Closed dvisockas closed 4 years ago

dvisockas commented 4 years ago

Hey,

Is there a reason why only keyword arguments can have default values? Syntax like:

class Make
  attr_initialize :target, params: {}
end

would take even more boilerplate out of peoples codebases IMO.

henrik commented 4 years ago

Hi! No, no reason I can think of off the top of my head. I'll close this issue since it's been answered, but a PR with good test coverage would be very welcome :)