Method: ContextAdaptation#deploy
- Defined in:
- lib/context_adaptation.rb
#deploy ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/context_adaptation.rb', line 18 def deploy x = @adapted_implementation y = self if @context != Context.default @adapted_class.send(:define_method, @adapted_selector, lambda do |args = x.parameters, ca = y| Context.stack= Context.stack.push(ca) r = x.call(args) Context.stack.pop() r end) else @adapted_class.send(:define_method, @adapted_selector, @adapted_implementation) end end |