Class: Journeybook::PublicPageConstraint

Inherits:
Object
  • Object
show all
Defined in:
lib/journeybook/public_page_constraint.rb

Constant Summary collapse

RESERVED_PATHS =
%w[
  /assets/
  /journeybook/
  /rails/
  /recede_historical_location
  /resume_historical_location
  /refresh_historical_location
  /up
].freeze

Instance Method Summary collapse

Instance Method Details

#matches?(request) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/journeybook/public_page_constraint.rb', line 13

def matches?(request)
  request.get? && html_request?(request) && RESERVED_PATHS.none? { |path| request.path.start_with?(path) }
end