Class: Copland::InterceptorChainBuilder::ProxyObjectChainElement

Inherits:
Object
  • Object
show all
Defined in:
lib/copland/interceptor-chain.rb

Overview

Encapsulates the end of an interceptor chain, which is the actual object being effected.

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ ProxyObjectChainElement

Create a new ProxyObjectChainElement that wraps the given object.



84
85
86
# File 'lib/copland/interceptor-chain.rb', line 84

def initialize( obj )
  @obj = obj
end

Instance Method Details

#process_next(context) ⇒ Object

Invoke the method represented by the context on the wrapped object.



89
90
91
# File 'lib/copland/interceptor-chain.rb', line 89

def process_next( context )
  @obj.__send__( context.sym, *context.args, &context.block )
end