Hi,
using contract_accessors, from time to time, I need to do forward declarations, because the class, which I want to enforce
with my accessor is not defined yet. For simple examples it is no problem to reorder the classes but when there are
circular references, there seems to be no way around forward references.
example:
class Parent
contract_accessor :child => Child
end
class Child
contract_accessor :parent => Parent
end
dirty workaround:
add
class Child;end
before Parent
To get around this, I propose to allow the use of symbols:
class Parent
contract_accessor :child => :Child
end
class Child
contract_accessor :parent => :Parent
end
This is fine for the Ruby interpreter and hopefully just a minor change.
Regards,
Benjamin Bock |