Methods
Public Instance methods
after(*args, &block)

Alias for post

around(*args)

Alias for wrap

before(*args, &block)

Alias for pre

observer(*args)

Alias for wrap

post(*args, &block)

Add a post (after) advice.

This method is also aliased as after
# File lib/facets/more/aspects.rb, line 211
    def post(*args, &block)
      o = options = { 
        :join => :post,
        :where => :append, 
      }
      options.update(args.pop) if args.last.is_a?(Hash)

      if block_given?
        new_advices = [ Advice.new(block, options) ]
      else
        new_advices = args.collect { |a| Advice.new(a, options) }
      end
#       if options[:where] == :prepend
#         self.advices = advices + self.advices
#       else
#         self.advices = self.advices + advices
#       end
      self.advices!.concat(new_advices)
    end
pre(*args, &block)

Add a pre (before) advice.

This method is also aliased as before
# File lib/facets/more/aspects.rb, line 188
    def pre(*args, &block)
      o = options = { 
        :join => :pre,
        :where => :prepend, 
      }
      options.update(args.pop) if args.last.is_a?(Hash)

      if block_given?
        new_advices = [ Advice.new(block, options) ]
      else
        new_advices = args.collect { |a| Advice.new(a, options) }
      end
#       if options[:where] == :prepend
#         self.advices = advices + self.advices
#       else
#         self.advices = self.advices + advices
#       end
      self.advices!.concat(new_advices)
    end
wrap(*args)

Add a wrap (arround) aspect. An aspect is a class that responds to the before and after advices.

This method is also aliased as around observer
# File lib/facets/more/aspects.rb, line 235
    def wrap(*args)
      o = options = {
        :pre => :pre,
        :post => :post
      }
      options.update(args.pop) if args.last.is_a?(Hash)

      for aspect in args
        self.advices! << Advice.new(aspect, options)
      end
    end