Class: Apartment::Elevators::FirstSubdomain

Inherits:
Subdomain show all
Defined in:
lib/apartment/elevators/first_subdomain.rb

Overview

Provides a rack based tenant switching solution based on the first subdomain of a given domain name. eg:

- example1.domain.com               => example1
- example2.something.domain.com     => example2

Instance Method Summary collapse

Methods inherited from Subdomain

excluded_subdomains, excluded_subdomains=

Methods inherited from Generic

#call, #initialize

Constructor Details

This class inherits a constructor from Apartment::Elevators::Generic

Instance Method Details

#parse_tenant_name(request) ⇒ Object



13
14
15
# File 'lib/apartment/elevators/first_subdomain.rb', line 13

def parse_tenant_name(request)
  super.split('.')[0] unless super.nil?
end