module Aquarium
class Echo
def method_missing sym, *args
p "Echoing: #{sym.to_s}: #{args.join(" ")}"
end
def respond_to? sym, include_private = false
true
end
end
end
Aquarium::Aspects::Aspect.new :around,
:calls_to => :method_missing,
:for_type => Aquarium::Echo do |jp, obj, sym, *args|
if sym == :log
p "--- Sending to log: #{args.join(" ")}"
else
jp.proceed
end
end
https://github.com/deanwampler/Aquarium