BlankSlate provides an abstract base class with no predefined methods (except for __send__ and __id__). BlankSlate is useful as a base class when writing classes that depend upon method_missing (e.g. dynamic proxies).

Methods
Public Class methods
find_hidden_method(name)
    # File lib/blankslate.rb, line 31
31:     def find_hidden_method(name)
32:       @hidden_methods ||= {}
33:       @hidden_methods[name] || superclass.find_hidden_method(name)
34:     end
hide(name)

Hide the method named name in the BlankSlate class. Don‘t hide instance_eval or any method beginning with "__".

    # File lib/blankslate.rb, line 22
22:     def hide(name)
23:       if instance_methods.include?(name.to_s) and
24:         name !~ /^(__|instance_eval)/
25:         @hidden_methods ||= {}
26:         @hidden_methods[name.to_sym] = instance_method(name)
27:         undef_method name
28:       end
29:     end
reveal(name)

Redefine a previously hidden method so that it may be called on a blank slate object.

    # File lib/blankslate.rb, line 38
38:     def reveal(name)
39:       hidden_method = find_hidden_method(name)
40:       fail "Don't know how to reveal method '#{name}'" unless hidden_method
41:       define_method(name, hidden_method)
42:     end