Class: Module

Inherits:
Object show all
Defined in:
lib/statsample.rb

Instance Method Summary collapse

Instance Method Details

#include_aliasing(m, suffix = 'ruby') ⇒ Object


45
46
47
48
49
50
51
52
53
# File 'lib/statsample.rb', line 45

def include_aliasing(m, suffix = 'ruby')
  m.instance_methods.each do |f|
    if instance_methods.include? f
      alias_method("#{f}_#{suffix}", f)
      remove_method f
    end
  end
  include m
end