I have a class hierarchy as follows:
class Tree
def initialize(id, value)
@id, @value = id, value
end
end
class Entity < Tree
include Mongoid::Document
def initialize(id, value)
# Do some stuff...
super(id, value)
end
end
However, calling super
inside the Entity#initialize
method calls the initialize
method located in Mongoid::Document
, instead of the one in the parent class Tree
.
How can I call the Tree#initialize
method from the body of Entity#initialize
, after the Mongoid::Document
module has been included?