Sha256: 8eeb06da1a8e8e1349b2e574360cecdb2db3ef242a81df0d1cd38ead73f764dc

Contents?: true

Size: 842 Bytes

Versions: 23

Compression:

Stored size: 842 Bytes

Contents

#
# This class provides an abstract for the router interface. Whilst any Proc
# could be used, it's safest for people to sub-class to ensure that any future
# interface changes are catered for.
#
# A router class's responsibility in Penthouse is to receive a Rack::Request
# object from the App instance and return an identifier for that tenant
#

module Penthouse
  module Routers
    class BaseRouter

      # @abstract typically used by the App to receive a request and return a tenant that can be switched to
      # @param request [Rack::Request] The request from the Rack app, used to determine the tenant
      # @return [String, Symbol] A tenant identifier
      # @raise [Penthouse::TenantNotFound] if the tenant cannot be found/switched to
      def self.call(request)
        raise NotImplementedError
      end

    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
penthouse-0.13.2 lib/penthouse/routers/base_router.rb
penthouse-0.13.1 lib/penthouse/routers/base_router.rb
penthouse-0.13 lib/penthouse/routers/base_router.rb
penthouse-0.12.2 lib/penthouse/routers/base_router.rb
penthouse-0.12.1 lib/penthouse/routers/base_router.rb
penthouse-0.12.0 lib/penthouse/routers/base_router.rb
penthouse-0.11.0 lib/penthouse/routers/base_router.rb
penthouse-0.10.1 lib/penthouse/routers/base_router.rb
penthouse-0.10.0 lib/penthouse/routers/base_router.rb
penthouse-0.9.0 lib/penthouse/routers/base_router.rb
penthouse-0.8.0 lib/penthouse/routers/base_router.rb
penthouse-0.7.5 lib/penthouse/routers/base_router.rb
penthouse-0.7.4 lib/penthouse/routers/base_router.rb
penthouse-0.7.3 lib/penthouse/routers/base_router.rb
penthouse-0.7.2 lib/penthouse/routers/base_router.rb
penthouse-0.7.1 lib/penthouse/routers/base_router.rb
penthouse-0.7.0 lib/penthouse/routers/base_router.rb
penthouse-0.6.0 lib/penthouse/routers/base_router.rb
penthouse-0.5.0 lib/penthouse/routers/base_router.rb
penthouse-0.4.2 lib/penthouse/routers/base_router.rb