Evaluate string in the context of binding. In this case 'foo' is executed as code in the context of binding. The second parameter is optional. It could either be a proc object or a binding object. If the second parameter is missing then the scope is set to current.
Evaluate the code inside the context of a class. Example:
self.inject do |s,e|
We can say something like "Array.class_eval('some goes here')" and the code will be executed within the context of Array class.
Same as class_eval
Here is an excellent article: