Hacker News new | past | comments | ask | show | jobs | submit login

> I don't know how to convert this into ruby then without needing to manually gensym a bunch of names

Sounds like you want something like: https://github.com/nicknovitski/modifiers

> Which is required if you're going to use value objects as much as possible rather than spraying mutable state everywhere.

Using Ruby's Struct class for this often avoids needing explicit constructors.




Except that package doesn't provide before/after/around.

What I really want is CLOS. But the closest in perl/python/ruby/javascript is Moose/Moo.

There's also, btw, a moosex gem where some rubyists are trying to port the perl stuff - but Moose/Moo are pervasive in modern OO perl whereas most existing ruby code is done the ugly, boilerplate-y way.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: