Sha256: bad2fdf2ea484f3d27d2da2599623a8790eec396209ecb3ede210781b7e32302

Contents?: true

Size: 479 Bytes

Versions: 25

Compression:

Stored size: 479 Bytes

Contents

#
# This router will load the tenant name based on a request's sub-domain
#

module Penthouse
  module Routers
    class SubdomainRouter < BaseRouter

      # Determines the tenant identifier based on the sub-domain of the request
      # @param request [Rack::Request] The request from the Rack app, used to determine the tenant
      # @return [String, Symbol] A tenant identifier
      def self.call(request)
        request.host.split(".").first
      end

    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

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