Sha256: b26eb5169e78c96e7f69d21385f511d92d6ee94e5ca6cf0c513f2c9c8e7e231e

Contents?: true

Size: 384 Bytes

Versions: 13

Compression:

Stored size: 384 Bytes

Contents

module Spank
  class InterceptorChain
    def initialize(interceptors = [])
      @interceptors = interceptors
    end

    def push(interceptor)
      @interceptors.push(interceptor)
    end

    def each(&block)
      @interceptors.each(&block)
    end

    def intercept(invocation)
      each do |interceptor|
        interceptor.intercept(invocation)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
spank-1.1.0 lib/spank/interceptor_chain.rb
spank-1.0.1441140881 lib/spank/interceptor_chain.rb
spank-1.0.1441140857 lib/spank/interceptor_chain.rb
spank-1.0.1441140848 lib/spank/interceptor_chain.rb
spank-1.0.1441140841 lib/spank/interceptor_chain.rb
spank-1.0.1441140834 lib/spank/interceptor_chain.rb
spank-1.0.1441140824 lib/spank/interceptor_chain.rb
spank-1.0.1441140809 lib/spank/interceptor_chain.rb
spank-1.0.1441140804 lib/spank/interceptor_chain.rb
spank-1.0.1441140793 lib/spank/interceptor_chain.rb
spank-1.0.1420314444 lib/spank/interceptor_chain.rb
spank-0.0.1393558686 lib/spank/interceptor_chain.rb
spank-0.0.1385937112 lib/spank/interceptor_chain.rb