barsoom / attr_extras

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

Accept a block for attr_initialize and friends #5

Closed jferris closed 10 years ago

jferris commented 10 years ago

The block is useful when using attr_extras in conjunction with classes like SimpleDelegator from Ruby's standard library. It's also helpful for setting up memoized lookup hashes.

henrik commented 10 years ago

I've thought about something like this. Looks simple and clean and you seem to have a specific use for it, so let's do it.

Could you also update README to document it?

jferris commented 10 years ago

Thanks! I updated the README in 346999b.

henrik commented 10 years ago

Thank you!