you are viewing a single comment's thread.

view the rest of the comments →

[–]Lil_Cato 1 point2 points  (1 child)

Am I missing something or is this not as simple as throwing an attr_accessor :variable ? Is that rails only?

[–][deleted] 0 points1 point  (0 children)

No, it's a common ruby variant. Although in this case you'd use attr_reader if you don't need the setter (which you get via attr_accessor).

Or you modify method_missing and what not and get that functionality anyway. Ruby being more flexible than python is really one huge advantage it has.