Sha256: 326900f1461f1b3cc1ba70212ccd27851a4702e1a01d489421cb34097099efe8

Contents?: true

Size: 356 Bytes

Versions: 6

Compression:

Stored size: 356 Bytes

Contents

module Waves

  module Matchers

    class Traits < Base
      
      def initialize( pattern ) ; @pattern = ( pattern or {} ) ; end
    
      def call( request )
        @pattern.all? do | key, val |
          ( val.is_a? Proc and val.call( request.traits[ key ] ) ) or val === request.traits[ key ]
        end
      end
      
    end
    
  end
  
end

Version data entries

6 entries across 6 versions & 4 rubygems

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