Class: Waves::Matchers::ContentType

Inherits:
Base show all
Defined in:
lib/matchers/content_type.rb

Instance Attribute Summary

Attributes inherited from Base

#constraints

Instance Method Summary collapse

Methods inherited from Base

#[], #test

Constructor Details

#initialize(content_type) ⇒ ContentType

Returns a new instance of ContentType.



7
# File 'lib/matchers/content_type.rb', line 7

def initialize( content_type ) ; @constraints = { :content_type => content_type } ; end

Instance Method Details

#call(request) ⇒ Object

we could maybe do something more sophisticated here, matching against content type patterns such */html or */xml, etc.; adapt from the matching done on accepts … ?



11
# File 'lib/matchers/content_type.rb', line 11

def call( request ) ; test( request ) ; end