barsoom / attr_extras

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

attr_accessor_initialize ? #18

Closed nitzanav closed 8 years ago

nitzanav commented 9 years ago

Hi,

I love attr_extras, I use it everywhere, and chose it the tenth of alternative, great work guys.

Though I have case that I need reader, writer and initializer. sometimes private, public or protected.

So why not enabling something like:

attr_accessor_initialize :foo, :goo

Instead of this:

attr_initialize :foo, :goo
attr_accessor :foo, :goo

or this:

attr_reader_initialize :foo, :goo
attr_writer :foo, :goo
henrik commented 9 years ago

Hey, thanks for the feedback!

That sounds like a reasonable addition. What would be a good short name for it? aattr_initialize? Too similar?

nitzanav commented 9 years ago

I agree that aattr_initialize is the right short name because it follows your convention in the best way.

I personally use the long names since they are more readable. Your methods are doing so much in so little code. Hence I don't see any reason to save 3 more characters as I saved so much already.

henrik commented 9 years ago

Sounds fair. Alright, if someone wants to make a PR for this it would be great. If not I'll leave this on my todo list and hope to get to it some day :)

henrik commented 8 years ago

Closed by PR #21.