Module | Aspects |
In: |
lib/facets/more/aspects.rb
|
Add support for Aspect Oriented Programming (AOP).
class Controller
pre :force_login, :where => :prepend wrap Benchmark, :on => :index post :taraa, :on => login
end
module Timestamped
pre :on => :og_insert { |this| this.create_time = Time.now } pre :on => :og_update { |this| this.update_time = Time.now } pre :on => [:og_insert, :og_update] { |this| this.create_time = Time.now }
end
Advice | = | Struct.new(:code, :options) | Store the code and the metadata (options) for an Advice. |
wrap | -> | apply_advices |