Method: Module#include_aliasing

Defined in:
lib/statsample.rb

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

[View source] [View on GitHub]

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