Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/greenbar/ClassMethodSetup.rb

Instance Method Summary collapse

Instance Method Details

#alias_class_method(new_name, old_name) ⇒ Object



22
23
24
25
26
# File 'lib/greenbar/ClassMethodSetup.rb', line 22

def alias_class_method new_name, old_name
  metaclass.instance_eval {
    alias_method new_name, old_name
  }
end

#metaclassObject



16
17
18
19
20
# File 'lib/greenbar/ClassMethodSetup.rb', line 16

def metaclass
  class << self
    return self
  end
end

#remove_class_method(method_name) ⇒ Object



28
29
30
31
32
# File 'lib/greenbar/ClassMethodSetup.rb', line 28

def remove_class_method method_name
  metaclass.instance_eval {
    remove_method method_name
  }
end