Skip to content

Instantly share code, notes, and snippets.

@gcao
Created June 14, 2010 12:43
Show Gist options
  • Save gcao/437639 to your computer and use it in GitHub Desktop.
Save gcao/437639 to your computer and use it in GitHub Desktop.
around :test do |proxy|
puts 'around 1 (before)'
result = a4r_invoke proxy
puts 'around 1 (after)'
result
end
before :test do
puts 'before'
end
after :test do |result|
puts 'after'
result
end
around :test do |proxy|
puts 'around 2 (before)'
result = a4r_invoke proxy
puts 'around 2 (after)'
result
end
def test
puts 'test'
end
instance.test
# ==== Output ====
# around 2 (before)
# before
# around 1 (before)
# test
# around 1 (after)
# after
# around 2 (after)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment