Skip to content

Instantly share code, notes, and snippets.

@gcao
Created June 8, 2010 13:01
Show Gist options
  • Save gcao/429969 to your computer and use it in GitHub Desktop.
Save gcao/429969 to your computer and use it in GitHub Desktop.
class A
include Aspect4r
before :test, :method_name_arg => true do |method, value|
puts "Entering #{method}(#{value.inspect})"
end
after :test, :method_name_arg => true do |method, result, value|
puts "Exiting from #{method} with result #{result.inspect}."
result
end
def test value
value
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment