M
Mike Austin
I have certain variables that are 'properties' and I keep track of them in a
class instance variable called @fields, and each subclass may have it's own
fields. I want to navigate through the hierarchy and go through each list, is
something like this possible?:
class View
@fields = [rigin]
def View.fields()
super.fields()
@fields
end
attr rigin
end
class Button < View
@fields = [:caption]
attr :caption
end
View.fields() actually finds :cation when I do Button.fields(), but super does
not work. Or maybe there is another way to do this?
Thanks,
Mike
class instance variable called @fields, and each subclass may have it's own
fields. I want to navigate through the hierarchy and go through each list, is
something like this possible?:
class View
@fields = [rigin]
def View.fields()
super.fields()
@fields
end
attr rigin
end
class Button < View
@fields = [:caption]
attr :caption
end
View.fields() actually finds :cation when I do Button.fields(), but super does
not work. Or maybe there is another way to do this?
Thanks,
Mike