Class: Waves::Matchers::Request
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #call(request) ⇒ Object
-
#initialize(options) ⇒ Request
constructor
A new instance of Request.
Methods inherited from Base
Constructor Details
#initialize(options) ⇒ Request
Returns a new instance of Request.
7 8 9 10 11 12 13 14 15 |
# File 'lib/matchers/request.rb', line 7 def initialize( ) @uri = Matchers::URI.new( ) @constraints = { :content_type => Matchers::ContentType.new( [ :content_type ] ), :accept => Matchers::Accept.new( ), :query => Matchers::Query.new( [:query] ), :traits => Matchers::Traits.new( [:traits] ) } end |
Instance Method Details
#call(request) ⇒ Object
17 18 19 20 21 |
# File 'lib/matchers/request.rb', line 17 def call( request ) if test( request ) and captured = @uri[ request ] request.traits.waves.captured = captured end end |