module Mumukit::Platform::OrganizationMapping

Public Class Methods

from_env() click to toggle source
# File lib/mumukit/platform/organization_mapping.rb, line 4
def self.from_env
  if ENV['RACK_ENV'] == 'test' || ENV['RAILS_ENV'] == 'test'
    Subdomain
  else
    parse ENV['MUMUKI_ORGANIZATION_MAPPING']
  end
end
parse(name) click to toggle source
# File lib/mumukit/platform/organization_mapping.rb, line 12
def self.parse(name)
  mapping = name.try { |it| it.strip.downcase }
  if mapping.blank? || mapping == 'path'
    Path
  elsif mapping == 'subdomain'
    Subdomain
  else
    raise "Unrecognized organization mapping #{mapping}"
  end
end