Module: Innate::Helper::Aspect::SingletonMethods
- Includes:
- Traited
- Defined in:
- /home/manveru/github/ramaze/ramaze.net/tmp/git/innate/lib/innate/helper/aspect.rb
Overview
Module containing various methods that will be made available as class methods to the class that included Innate::Helper::Aspect.
Instance Method Summary (collapse)
-
- (Object) add_action_wrapper(order, method_name)
-
- (Object) after(*names, &block)
Hook that is called after a specific list of actions.
-
- (Object) after_all(&block)
Hook that is called after all the actions in a node.
-
- (Object) before(*names, &block)
Hook that is called before a specific list of actions.
-
- (Object) before_all(&block)
Hook that is called before all the actions in a node.
-
- (Object) wrap(*names, &block)
Wraps the block around the list of actions resulting in the block being called both before and after each action.
Methods included from Traited
#ancestral_trait, #ancestral_trait_values, #class_trait, #each_ancestral_trait, included, #trait
Instance Method Details
- (Object) add_action_wrapper(order, method_name)
282 283 284 285 286 287 288 |
# File '/home/manveru/github/ramaze/ramaze.net/tmp/git/innate/lib/innate/helper/aspect.rb', line 282 def add_action_wrapper(order, method_name) if wrap = trait[:wrap] wrap.merge(SortedSet[[order, method_name.to_s]]) else trait :wrap => SortedSet[[order, method_name.to_s]] end end |
- (Object) after(*names, &block)
Hook that is called after a specific list of actions.
248 249 250 |
# File '/home/manveru/github/ramaze/ramaze.net/tmp/git/innate/lib/innate/helper/aspect.rb', line 248 def after(*names, &block) names.each{|name| AOP[self][:after][name] = block } end |
- (Object) after_all(&block)
Hook that is called after all the actions in a node.
220 221 222 |
# File '/home/manveru/github/ramaze/ramaze.net/tmp/git/innate/lib/innate/helper/aspect.rb', line 220 def after_all(&block) AOP[self][:after_all] = block end |
- (Object) before(*names, &block)
Hook that is called before a specific list of actions.
196 197 198 |
# File '/home/manveru/github/ramaze/ramaze.net/tmp/git/innate/lib/innate/helper/aspect.rb', line 196 def before(*names, &block) names.each{|name| AOP[self][:before][name] = block } end |
- (Object) before_all(&block)
Hook that is called before all the actions in a node.
168 169 170 |
# File '/home/manveru/github/ramaze/ramaze.net/tmp/git/innate/lib/innate/helper/aspect.rb', line 168 def before_all(&block) AOP[self][:before_all] = block end |
- (Object) wrap(*names, &block)
Wraps the block around the list of actions resulting in the block being called both before and after each action.
277 278 279 280 |
# File '/home/manveru/github/ramaze/ramaze.net/tmp/git/innate/lib/innate/helper/aspect.rb', line 277 def wrap(*names, &block) before(*names, &block) after(*names, &block) end |