Sha256: 8e13d8573bc0ceaaa8ed0dbb8e838e40ea147ca2da4cd6a92649a85d2e9b870a
Contents?: true
Size: 445 Bytes
Versions: 29
Compression:
Stored size: 445 Bytes
Contents
# frozen_string_literal: true module PagesCore class PagePathConstraint def matches?(request) locale?(request.path_parameters[:locale]) && exists?( request.path_parameters[:locale], request.path_parameters[:path] ) end private def locale?(str) str.to_s =~ /\A[a-z]{2}\z/ end def exists?(locale, path) PagePath.get(locale, path) ? true : false end end end
Version data entries
29 entries across 29 versions & 1 rubygems