Sha256: 98e7886ab34b6851cda1923b3482bf68f2f52794bc649873df42fdfba0149a2d
Contents?: true
Size: 659 Bytes
Versions: 2
Compression:
Stored size: 659 Bytes
Contents
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'aspect4r' class A class << self include Aspect4r around :test do |proxy, input| puts 'around test (before)' result = a4r_invoke proxy, input puts 'around test (after)' result end before :test do |input| puts 'before test' end after :test do |result, input| puts 'after test' result end def test input puts 'test' input end end end puts "Example 1:" puts A.test(1) # ==== Output ==== # before test # around test (before) # test # around test (after) # after test # 1
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
aspect4r-0.9.0 | examples/advices_on_class_method_example.rb |
aspect4r-0.8.2 | examples/advices_on_class_method_example.rb |