Sha256: 9231468ff1919a99646e04e43aa2257141f6da6e14bf1302385e0e06658d28cf

Contents?: true

Size: 446 Bytes

Versions: 31

Compression:

Stored size: 446 Bytes

Contents

module Awestruct

  class HandlerChain

    attr_reader :matcher
    attr_reader :handler_classes

    def initialize(matcher, *handler_classes)
      @matcher         = matcher
      @handler_classes = handler_classes
    end

    def matches?(path)
      @matcher.match( path )
    end

    def create(site, path)
      cur = path
      @handler_classes.each do |cls|
        cur = cls.new( site, cur )
      end
      cur
    end

  end

end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
awestruct-0.5.4.rc3 lib/awestruct/handler_chain.rb
awestruct-0.5.4.rc2 lib/awestruct/handler_chain.rb
awestruct-0.5.4.rc lib/awestruct/handler_chain.rb
awestruct-0.5.4.beta1 lib/awestruct/handler_chain.rb
awestruct-0.5.3 lib/awestruct/handler_chain.rb
awestruct-0.5.2.1 lib/awestruct/handler_chain.rb
awestruct-0.5.2 lib/awestruct/handler_chain.rb
awestruct-0.5.1 lib/awestruct/handler_chain.rb
awestruct-0.5.1a lib/awestruct/handler_chain.rb
awestruct-0.5.0 lib/awestruct/handler_chain.rb
awestruct-0.5.0.cr lib/awestruct/handler_chain.rb
awestruct-0.4.8 lib/awestruct/handler_chain.rb
awestruct-0.4.7 lib/awestruct/handler_chain.rb
awestruct-0.4.6 lib/awestruct/handler_chain.rb
awestruct-0.4.5 lib/awestruct/handler_chain.rb
awestruct-0.4.4 lib/awestruct/handler_chain.rb
awestruct-0.4.3 lib/awestruct/handler_chain.rb
awestruct-0.4.2 lib/awestruct/handler_chain.rb
awestruct-0.4.2.x10 lib/awestruct/handler_chain.rb
awestruct-0.4.2.x9 lib/awestruct/handler_chain.rb