Sha256: 24894d3780635963d76cb376d9caeee3ef6c1c6cf7ea58d5f8f8eca683c857a0
Contents?: true
Size: 481 Bytes
Versions: 15
Compression:
Stored size: 481 Bytes
Contents
module Spank class InterceptorRegistration def initialize(method_symbol) @method = method_symbol @interceptors = [] end def with(interceptor) @interceptors.push(interceptor) self end def and(interceptor) with(interceptor) end def intercept(instance) proxy = Proxy.new(instance) @interceptors.each do |interceptor| proxy.add_interceptor(@method, interceptor) end proxy end end end
Version data entries
15 entries across 15 versions & 1 rubygems