1 # depends on: module.rb class.rb
9 Object.public(*methods)
13 Object.private(*methods)
16 def protected(*methods)
17 Object.protected(*methods)
20 def add_method(name, obj)
21 Object.add_method(name, obj)
24 def alias_method(new_name, current_name)
25 Object.__send__ :alias_method, new_name, current_name
28 def __const_set__(name, obj)
29 Object.__const_set__(name, obj)
41 raise LocalJumpError, "not callable"
48 alias_method :inspect, :to_s
55 alias_method :inspect, :to_s
60 Undefined = Object.new
63 # This is used to prevent recursively traversing an object graph.
66 def self.inspecting?(obj)
67 stack.include?(obj.object_id)
70 def self.inspect(obj, &block)
71 stack.push(obj.object_id)
80 stack = Thread.current[:inspecting] ||= []