Removes code duplication by meta programmatically generating class instance variable reader #73

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@gnufied
Contributor
gnufied commented Oct 6, 2010

No description provided.

Hemant Kumar add meta programmaitcally defined class instance variable reader and
remove code duplication from activeresouece base class
958c1ba
@josevalim
Member

Good initiative! But I believe that code could instead be refactored to use the new class_attribute instead. What do you think?

@gnufied
Contributor
gnufied commented Oct 6, 2010

Not without major surgery. class_attribute relies on captured variable on the callstack (it doesn't use class instance variable underneath) and class_attribute insists on defining class writer for attributes.

@gnufied
Contributor
gnufied commented Oct 6, 2010

It would be good to have a reader for reading class instance variables btw, otherwise we can make the method "inheritable_class_instance_reader" local as well.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment