Class: Rack::Router
Overview
A minimal router providing just what is needed for the OAuth and OpenID filters.
Instance Method Summary collapse
-
#===(request) ⇒ Object
By overriding the case comparison operator, we can match routes in a case statement.
-
#initialize(method, path, params = []) ⇒ Router
constructor
Create an instance of Router to match on method, path and params.
Constructor Details
#initialize(method, path, params = []) ⇒ Router
Create an instance of Router to match on method, path and params.
8 9 10 |
# File 'lib/cloudkit/rack/router.rb', line 8 def initialize(method, path, params=[]) @method = method.to_s.upcase; @path = path; @params = params end |
Instance Method Details
#===(request) ⇒ Object
By overriding the case comparison operator, we can match routes in a case statement.
See also: CloudKit::Util#r, CloudKit::Request#match?
16 17 18 |
# File 'lib/cloudkit/rack/router.rb', line 16 def ===(request) request.match?(@method, @path, @params) end |