Take the following code in ruby 3.3.0:
module A
def print
puts "A"
end
end
module B
def print
puts "B"
end
end
class C
end
c_instance = C.new
C.send(:include, A)
c_instance.print
C.send(:include, B)
c_instance.print
C.send(:include, A)
c_instance.print
I expected it to print out:
A
B
A
But it prints out
A
B
B
Why is that?