Type:
Class

Core extension library

Rake extensions to Module.

A Module is a collection of methods and constants. The methods in a module may be instance methods or module methods. Instance methods appear as methods in a class when the module is included, module methods do not. Conversely, module methods may be called without creating an encapsulating object, while instance methods may not. (See Module#module_function)

In the descriptions that follow, the parameter sym refers to a symbol, which is either a quoted string or a Symbol (such as :name).

1
2
3
4
5
6
7
8
9
10
module Mod
  include Math
  CONST = 1
  def meth
    #  ...
  end
end
Mod.class              #=> Module
Mod.constants          #=> [:CONST, :PI, :E]
Mod.instance_methods   #=> [:meth]
new
  • References/Ruby on Rails/Ruby/Classes/Module

Module.new â modModule.new {|mod| block } â mod Class Public methods

2025-01-10 15:47:30
instance_method
  • References/Ruby on Rails/Ruby/Classes/Module

mod.instance_method(symbol) â unbound_method Instance Public methods Returns

2025-01-10 15:47:30
inspect
  • References/Ruby on Rails/Ruby/Classes/Module

inspect() Instance Public methods Alias for:

2025-01-10 15:47:30
<=
  • References/Ruby on Rails/Ruby/Classes/Module

mod Instance Public methods Returns true

2025-01-10 15:47:30
===
  • References/Ruby on Rails/Ruby/Classes/Module

mod === obj â true or false Instance Public methods Case EqualityâReturns

2025-01-10 15:47:30
rake_extension
  • References/Ruby on Rails/Ruby/Classes/Module

rake_extension(method) Instance Public methods Check for an existing method

2025-01-10 15:47:30
public_method_defined?
  • References/Ruby on Rails/Ruby/Classes/Module

mod.public_method_defined?(symbol) â true or false Instance Public methods Returns

2025-01-10 15:47:30
public_class_method
  • References/Ruby on Rails/Ruby/Classes/Module

mod.public_class_method(symbol, ...) â mod Instance Public methods Makes

2025-01-10 15:47:30
==
  • References/Ruby on Rails/Ruby/Classes/Module

obj == other â true or falseobj.equal?(other) â true or falseobj.eql?(other) â true or false

2025-01-10 15:47:30
module_exec
  • References/Ruby on Rails/Ruby/Classes/Module

mod.module_exec(arg...) {|var...| block } â obj Instance Public methods Evaluates

2025-01-10 15:47:30