<=>

module other_module â -1, 0, +1, or nil Instance Public methods ComparisonâReturns -1, 0, +1 or nil depending on whether module includes other_module, they are the same, or if module is included by other_module. This is the basis for the tests in Comparable. Returns nil if module has no relationship with other_module, if other_module is not a module, or if the two values are incomparable.

==

obj == other â true or falseobj.equal?(other) â true or falseobj.eql?(other) â true or false Instance Public methods Equality â At the Object level, == returns true only if obj and other are the same object. Typically, this method is overridden in descendant classes to provide class-specific meaning. Unlike ==, the equal? method should never be overridden by subclasses as it is used to determine object identity (that is, a.equal?(b) if and only if a is the same object

===

mod === obj â true or false Instance Public methods Case EqualityâReturns true if anObject is an instance of mod or one of mod's descendants. Of limited use for modules, but can be used in case statements to classify objects by class.

>

mod > other â true, false, or nil Instance Public methods Returns true if mod is an ancestor of other. Returns nil if there's no relationship between the two. (Think of the relationship in terms of the class definition: âclass A<Bâ implies âB>Aâ).

&gt;=

mod >= other â true, false, or nil Instance Public methods Returns true if mod is an ancestor of other, or the two modules are the same. Returns nil if there's no relationship between the two. (Think of the relationship in terms of the class definition: âclass A<Bâ implies âB>Aâ).

ancestors

mod.ancestors â array Instance Public methods Returns a list of modules included in mod (including mod itself). module Mod include Math include Comparable end Mod.ancestors #=> [Mod, Comparable, Math] Math.ancestors #=> [Math]

autoload

mod.autoload(module, filename) â nil Instance Public methods Registers filename to be loaded (using Kernel::require) the first time that module (which may be a String or a symbol) is accessed in the namespace of mod. module A end A.autoload(:B, "b") A::B.doit # autoloads "b"

autoload?

mod.autoload?(name) â String or nil Instance Public methods Returns filename to be loaded if name is registered as autoload in the namespace of mod. module A end A.autoload(:B, "b") A.autoload?(:B) #=> "b"

class_eval

mod.class_eval(string [, filename [, lineno]]) â obj Instance Public methods 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.h

class_exec

mod.class_exec(arg...) {|var...| block } â obj Instance Public methods Evaluates the given block in the context of the class/module. The method defined in the block will belong to the receiver. class Thing end Thing.class_exec{ def hello() "Hello there!" end } puts Thing.new.hello() produces: Hello there!