# File lib/facets/more/cut.rb, line 116 def join( points=nil ) @points ||= {} return @points unless points code = '' points.each do |advice, pointcut| case pointcut when Regexp @points[advice] = lambda { |jp| pointcut =~ jp } when Proc @points[advice] = pointcut else [pointcut].flatten.uniq.each do |method| code << %{ def #{method}(*args,&block) #{advice}( target(:"#{method}"){ super } ) end } #Thought about putting advice in separate namespace (option?) #ObjectSpace._id2ref(#{object_id}).advice.#{advice}( this(:"#{method}"){ super } ) end end end module_eval code end