class BlankSlate


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

def find_hidden_method(name)

def find_hidden_method(name)
  @hidden_methods ||= {}
  @hidden_methods[name] || superclass.find_hidden_method(name)
end

def hide(name)

hide +instance_eval+ or any method beginning with "__".
Hide the method named +name+ in the BlankSlate class. Don't
def hide(name)
  if instance_methods.include?(name.to_s) and
    name !~ /^(__|instance_eval)/
    @hidden_methods ||= {}
    @hidden_methods[name.to_sym] = instance_method(name)
    undef_method name
  end
end

def reveal(name)

slate object.
Redefine a previously hidden method so that it may be called on a blank
def reveal(name)
  hidden_method = find_hidden_method(name)
  fail "Don't know how to reveal method '#{name}'" unless hidden_method
  define_method(name, hidden_method)
end