Created
February 1, 2013 19:04
-
-
Save dabit/4693322 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def matches?(env) | |
req = @request.new(env) | |
@constraints.each { |constraint| | |
if constraint.respond_to?(:matches?) && !constraint.matches?(req) | |
return false | |
elsif constraint.respond_to?(:call) && !constraint.call(*constraint_args(constraint, req)) | |
return false | |
end | |
} | |
return true | |
ensure | |
req.reset_parameters | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment