This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.

class_eval

        # Module.class_eval

(from ruby core)
---
    class_eval(*args)

---

Evaluates the string or block in the context of *mod*, except that when
a block is given, constant/class variable lookup is not affected. This
can be used to add methods to a class. `module_eval` returns the result
of evaluating its argument. The optional *filename* and *lineno*
parameters set the text for error messages.

    class Thing
    end
    a = %q{def hello() "Hello there!" end}
    Thing.module_eval(a)
    puts Thing.new.hello()
    Thing.module_eval("invalid code", "dummy", 123)

*produces:*

    Hello there!
    dummy:123:in `module_eval': undefined local variable
        or method `code' for Thing:Class


(This method is an alias for Module#module_eval.)

Evaluates the string or block in the context of *mod*, except that when
a block is given, constant/class variable lookup is not affected. This
can be used to add methods to a class. `module_eval` returns the result
of evaluating its argument. The optional *filename* and *lineno*
parameters set the text for error messages.

    class Thing
    end
    a = %q{def hello() "Hello there!" end}
    Thing.module_eval(a)
    puts Thing.new.hello()
    Thing.module_eval("invalid code", "dummy", 123)

*produces:*

    Hello there!
    dummy:123:in `module_eval': undefined local variable
        or method `code' for Thing:Class



      

This is MURDOC! A Ruby documentation browser inspired by Smalltalk-80. It allows you to learn about Ruby by browsing through its class hierarchies, and see any of its methods.