Class: Seasar::Aop::MethodInvocation
- Inherits:
-
Object
- Object
- Seasar::Aop::MethodInvocation
- Defined in:
- lib/seasar/aop/method-invocation.rb
Overview
アスペクトされたインターセプターを管理・実行するクラスです。アスペクトされたメソッドが実行される度にインスタンス化されます。
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#component_class ⇒ Object
Returns the value of attribute component_class.
-
#enhanced_class ⇒ Object
Returns the value of attribute enhanced_class.
-
#interceptors ⇒ Object
Returns the value of attribute interceptors.
-
#method ⇒ Object
Returns the value of attribute method.
-
#procedure ⇒ Object
Returns the value of attribute procedure.
-
#this ⇒ Object
Returns the value of attribute this.
Instance Method Summary collapse
-
#initialize ⇒ MethodInvocation
constructor
MethodInvocationを構築します。 - args - none.
-
#proceed ⇒ Object
MethodInvocation自身および、保持しているインターセプタから呼び出されます。 すべてのインターセプタが実行されたのちにターゲットメソッドが実行されます。.
Constructor Details
#initialize ⇒ MethodInvocation
MethodInvocationを構築します。
-
args
-
none
-
28 29 30 31 32 33 34 35 36 |
# File 'lib/seasar/aop/method-invocation.rb', line 28 def initialize @index = 0 @method = nil @interceptors = nil @enhanced_class = nil @component_class = nil @args = nil @this = nil end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
37 38 39 |
# File 'lib/seasar/aop/method-invocation.rb', line 37 def args @args end |
#component_class ⇒ Object
Returns the value of attribute component_class.
37 38 39 |
# File 'lib/seasar/aop/method-invocation.rb', line 37 def component_class @component_class end |
#enhanced_class ⇒ Object
Returns the value of attribute enhanced_class.
37 38 39 |
# File 'lib/seasar/aop/method-invocation.rb', line 37 def enhanced_class @enhanced_class end |
#interceptors ⇒ Object
Returns the value of attribute interceptors.
37 38 39 |
# File 'lib/seasar/aop/method-invocation.rb', line 37 def interceptors @interceptors end |
#method ⇒ Object
Returns the value of attribute method.
37 38 39 |
# File 'lib/seasar/aop/method-invocation.rb', line 37 def method @method end |
#procedure ⇒ Object
Returns the value of attribute procedure.
37 38 39 |
# File 'lib/seasar/aop/method-invocation.rb', line 37 def procedure @procedure end |
#this ⇒ Object
Returns the value of attribute this.
37 38 39 |
# File 'lib/seasar/aop/method-invocation.rb', line 37 def this @this end |
Instance Method Details
#proceed ⇒ Object
MethodInvocation自身および、保持しているインターセプタから呼び出されます。すべてのインターセプタが実行されたのちにターゲットメソッドが実行されます。
-
args
-
none
-
-
return
-
mixed
-
47 48 49 50 51 52 53 54 |
# File 'lib/seasar/aop/method-invocation.rb', line 47 def proceed if @index < @interceptors.length @index += 1 return @interceptors[@index - 1].call(self) else return @method.call(*@args, &@procedure) end end |