Class: Fuik::Routing::ProviderConstraint

Inherits:
Object
  • Object
show all
Defined in:
lib/fuik/routing/provider_constraint.rb

Instance Method Summary collapse

Instance Method Details

#matches?(request) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
9
10
11
12
13
14
# File 'lib/fuik/routing/provider_constraint.rb', line 6

def matches?(request)
  return true if allow_all?
  return explicit_allowlist.include?(request.params[:provider]) if explicit_allowlist?

  return Rails.env.local? if providers_allowed.nil?
  return Rails.env.local? if providers_allowed == true

  scanned_allowlist.include?(request.params[:provider])
end