aboutsummaryrefslogblamecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/module/method_transplanting.rb
blob: b1097cc83b8fd5b6d4934cc14101ee60f0427984 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                              
class Module
  ###
  # TODO: remove this after 1.9 support is dropped
  def methods_transplantable? # :nodoc:
    x = Module.new { def foo; end }
    Module.new { define_method :bar, x.instance_method(:foo) }
    true
  rescue TypeError
    false
  end
end