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
F
H
R
Class Public methods
find_hidden_method(name)
# File activesupport/lib/active_support/vendor/builder-2.1.2/blankslate.rb, line 31
def find_hidden_method(name)
  @hidden_methods ||= {}
  @hidden_methods[name] || superclass.find_hidden_method(name)
end
hide(name)

Hide the method named namein the BlankSlate class. Don't hide instance_evalor any method beginning with “__”.

# File activesupport/lib/active_support/vendor/builder-2.1.2/blankslate.rb, line 22
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
reveal(name)

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

# File activesupport/lib/active_support/vendor/builder-2.1.2/blankslate.rb, line 38
def reveal(name)
  bound_method = nil
  unbound_method = find_hidden_method(name)
  fail "Don't know how to reveal method '#{name}'" unless unbound_method
  define_method(name) do |*args|
    bound_method ||= unbound_method.bind(self)
    bound_method.call(*args)
  end
end