I have several classes that have circular dependencies on each other.
See following example.
@can_upgrade_to = [Knight]
#or use constant from Knight class
raise "Unable to upgrade" unless @can_upgrade_to.contain(to)
class Knight < Solder
I cant use Knight constant (class name) before Solder and can't use
Solder before Knight.
I am just come from Java lang and for Java circular class deps is not
But ruby is a dynamic language and it creates classes just on script
So my questions is: how to solve this problem? What is the best way to
deal with it.