Class ActsAsFerret::BlankSlate
In: lib/blank_slate.rb
Parent: BasicObject

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

hide   reveal  

Public Class methods

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

[Source]

    # File lib/blank_slate.rb, line 32
32:         def hide(name)
33:           if instance_methods.include?(name.to_s) and name !~ /^(__|instance_eval|methods)/
34:             @hidden_methods ||= {}
35:             @hidden_methods[name.to_sym] = instance_method(name)
36:             undef_method name
37:           end
38:         end

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

no-op here since we don‘t hide the methods we reveal where this is used in this implementation

[Source]

    # File lib/blank_slate.rb, line 45
45:         def reveal(name)
46:         end

[Validate]