class Apartment::Elevators::HostHash
Uses a hash to find the corresponding tenant name for the host
Provides a rack based tenant switching solution based on hosts
def initialize(app, hash = {}, processor = nil)
def initialize(app, hash = {}, processor = nil) super app, processor @hash = hash end
def parse_tenant_name(request)
def parse_tenant_name(request) raise DatabaseNotFound, "Cannot find tenant for host #{request.host}" unless @hash.has_key?(request.host) @hash[request.host] end