Module: BlankSlate::ClassMethods

Defined in:
lib/blank_slate.rb

Instance Method Summary collapse

Instance Method Details

#hide(name) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/blank_slate.rb', line 30

def hide ( name )
  return unless instance_methods.include? name.to_s
  return if blank_slate_ignore(name)
  long = "__blank_slate_#{name}"
  alias_method long, name unless instance_methods.include? long
  undef_method name
end

#restore(name) ⇒ Object



38
39
40
41
42
43
# File 'lib/blank_slate.rb', line 38

def restore ( name )
  long = "__blank_slate_#{name}"
  if instance_methods.include? long
    alias_method name, long
  end
end