Module: Mumukit::Platform::WebFramework::Rails

Defined in:
lib/mumukit/platform/web_framework.rb

Defined Under Namespace

Classes: LazyString

Class Method Summary collapse

Class Method Details

.configure_tenant_path_routes!(mapper, &block) ⇒ Object



17
18
19
# File 'lib/mumukit/platform/web_framework.rb', line 17

def self.configure_tenant_path_routes!(mapper, &block)
  mapper.scope '/:tenant', tenant_scope_options, &block
end

.lazy_string(&block) ⇒ Object



13
14
15
# File 'lib/mumukit/platform/web_framework.rb', line 13

def self.lazy_string(&block)
  LazyString.new(proc(&block))
end

.tenant_scope_optionsObject



21
22
23
24
25
26
# File 'lib/mumukit/platform/web_framework.rb', line 21

def self.tenant_scope_options
  {
      defaults: { tenant: lazy_string { Mumukit::Platform.current_organization_name } },
      constraints: { tenant: Mumukit::Platform::Organization.valid_name_regex }
  }
end