Examveda

What is the main difference between instance_eval and class_eval in Ruby?

A. instance_eval evaluates code within the context of a method, while class_eval evaluates code within the context of a block

B. instance_eval evaluates code within the context of a block, while class_eval evaluates code within the context of a method

C. instance_eval evaluates code within the context of an object, while class_eval evaluates code within the context of a class

D. instance_eval evaluates code within the context of a class, while class_eval evaluates code within the context of an object

Answer: Option C


This Question Belongs to Ruby Programming >> Advanced Topics In Ruby

Join The Discussion

Related Questions on Advanced Topics in Ruby