class Joinpoint
TODO: pass actual method instead of using instace_method ?
Public Class Methods
new(object, base, method, *args, &block)
click to toggle source
# File lib/cuts/aop.rb, line 31 def initialize(object, base, method, *args, &block) @object = object @base = base @method = method @args = args @block = block end
Public Instance Methods
==(sym)
click to toggle source
# File lib/cuts/aop.rb, line 48 def ==(sym) sym.to_sym == @method.to_sym end
===(match)
click to toggle source
# File lib/cuts/aop.rb, line 39 def ===(match) case match when Proc match.call(self) else # Pattern matches (not supported presently) match.to_sym == @method.to_sym end end
super()
click to toggle source
# File lib/cuts/aop.rb, line 54 def super anc = @object.class.ancestors.find{ |anc| anc.method_defined?(@method) } anc.instance_method(@method).bind(@object).call(*@args, &@block) end