I am new to ruby and today I found some different behaviour of class_eval for string and block. For example
class A
end
class C
A.class_eval("print Module.nesting") # [A, C]
A.class_eval{print Module.nesting} # [C]
end
As you can see in the case of the string Module.nesting prints [A,C], while in the case of block it prints only C.
Could you please tell me the reason for this?