Sha256: 1a77832b1e47df3fdaac257ef9c065eda91ddc958181ecc93d6765514e5419b5

Contents?: true

Size: 638 Bytes

Versions: 6

Compression:

Stored size: 638 Bytes

Contents

module Waves

  module Matchers

    class Request < Base
      
      def initialize( options )
        @uri = Matchers::URI.new( options )
        @constraints = {
          :content_type => Matchers::ContentType.new( options[ :content_type ] ),
          :accept => Matchers::Accept.new( options ),
          :query => Matchers::Query.new( options[:query] ),
          :traits => Matchers::Traits.new( options[:traits] )
        }
      end

      def call( request )
        if test( request ) and captured = @uri[ request ]
          request.traits.waves.captured = captured
        end
      end
          
    end
    
  end
  
end

Version data entries

6 entries across 6 versions & 4 rubygems

Version Path
dyoder-waves-0.8.0 lib/matchers/request.rb
waves-edge-2009.03.10.13.14 lib/matchers/request.rb
waves-stable-2009.3.10 lib/matchers/request.rb
waves-0.8.2 lib/matchers/request.rb
waves-0.8.0 lib/matchers/request.rb
waves-0.8.1 lib/matchers/request.rb