module Prependable::Self

Public Instance Methods

method_added(meth) click to toggle source
# File lib/core-uncommon/facets/module/prepend.rb, line 15
def method_added(meth)
  return if meth.to_s[-2,2] == ':-'
  alias_method "#{meth}:-", meth
  remove_method(meth)
  prepend_module.module_eval %Q{
    def #{meth}(*a,&b); __send__("#{meth}:-",*a,&b); end
  }
  include prepend_module
end
prepend_module() click to toggle source
# File lib/core-uncommon/facets/module/prepend.rb, line 11
def prepend_module
  @_prepend_module ||= Module.new
end