Module: RouteTranslator::HostPathConsistencyLambdas

Defined in:
lib/route_translator/host_path_consistency_lambdas.rb

Class Method Summary collapse

Class Method Details

.for_locale(locale) ⇒ Object



15
16
17
18
19
# File 'lib/route_translator/host_path_consistency_lambdas.rb', line 15

def for_locale(locale)
  sanitized_locale = RouteTranslator::LocaleSanitizer.sanitize(locale)

  lambdas[sanitized_locale] ||= ->(req) { sanitized_locale == RouteTranslator::Host.locale_from_host(req.host).to_s }
end