Module: Mumukit::Platform::OrganizationMapping::Subdomain
- Extended by:
- Base
- Defined in:
- lib/mumukit/platform/organization_mapping.rb
Class Method Summary collapse
- .implicit_organization?(request, domain) ⇒ Boolean
- .inorganic_path_for(request) ⇒ Object
- .map_organization_routes!(native, _framework, &block) ⇒ Object
- .organic_uri(uri, organization) ⇒ Object
- .organization_name(request, domain) ⇒ Object
- .path_under_namespace?(_organization_name, path, namespace) ⇒ Boolean
Methods included from Base
Class Method Details
.implicit_organization?(request, domain) ⇒ Boolean
32 33 34 |
# File 'lib/mumukit/platform/organization_mapping.rb', line 32 def self.implicit_organization?(request, domain) request.empty_subdomain_after?(domain) end |
.inorganic_path_for(request) ⇒ Object
52 53 54 |
# File 'lib/mumukit/platform/organization_mapping.rb', line 52 def self.inorganic_path_for(request) path_for(request) end |
.map_organization_routes!(native, _framework, &block) ⇒ Object
36 37 38 |
# File 'lib/mumukit/platform/organization_mapping.rb', line 36 def self.map_organization_routes!(native, _framework, &block) native.instance_eval(&block) end |
.organic_uri(uri, organization) ⇒ Object
44 45 46 |
# File 'lib/mumukit/platform/organization_mapping.rb', line 44 def self.organic_uri(uri, organization) uri.subdominate(organization, fragmented: true) end |
.organization_name(request, domain) ⇒ Object
40 41 42 |
# File 'lib/mumukit/platform/organization_mapping.rb', line 40 def self.organization_name(request, domain) request.subdomain_after(domain) || 'central' end |
.path_under_namespace?(_organization_name, path, namespace) ⇒ Boolean
48 49 50 |
# File 'lib/mumukit/platform/organization_mapping.rb', line 48 def self.path_under_namespace?(_organization_name, path, namespace) path.start_with? "/#{namespace}/" end |