Class: ActsAsFerret::BlankSlate
- Inherits:
-
BlankSlate
- Object
- BlankSlate
- ActsAsFerret::BlankSlate
- Defined in:
- lib/acts_as_ferret/blank_slate.rb,
lib/acts_as_ferret/blank_slate.rb,
lib/acts_as_ferret/blank_slate.rb,
lib/acts_as_ferret/blank_slate.rb
Overview
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).
Direct Known Subclasses
Class Method Summary collapse
-
.hide(name) ⇒ Object
Hide the method named
name
in the BlankSlate class.
Class Method Details
.hide(name) ⇒ Object
Hide the method named name
in the BlankSlate class. Don’t hide instance_eval
or any method beginning with “__”.
40 41 42 43 44 45 46 |
# File 'lib/acts_as_ferret/blank_slate.rb', line 40 def hide(name) if instance_methods.include?(name.to_s) and name !~ /^(__|instance_eval|methods)/ @hidden_methods ||= {} @hidden_methods[name.to_sym] = instance_method(name) undef_method name end end |