Class Rack::Router

  1. lib/cloudkit/rack/router.rb
Parent: Object

A minimal router providing just what is needed for the OAuth and OpenID filters.


public class

  1. new

public instance

  1. ===

Public class methods

new (method, path, params=[])

Create an instance of Router to match on method, path and params.

[show source]
    # File lib/cloudkit/rack/router.rb, line 8
 8:     def initialize(method, path, params=[])
 9:       @method = method.to_s.upcase; @path = path; @params = params
10:     end

Public instance methods

=== (request)

By overriding the case comparison operator, we can match routes in a case statement.

See also: CloudKit::Util#r, CloudKit::Request#match?

[show source]
    # File lib/cloudkit/rack/router.rb, line 16
16:     def ===(request)
17:       request.match?(@method, @path, @params)
18:     end