Class: Prelaunch::TokenConstraint

Inherits:
Object
  • Object
show all
Defined in:
lib/prelaunch/constraints.rb

Instance Method Summary collapse

Instance Method Details

#matches?(request) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
13
14
15
16
# File 'lib/prelaunch/constraints.rb', line 9

def matches? request
  path  = Prelaunch::strip_slashes(Prelaunch.verify_path)
  match = request.fullpath.match(/^#{path}\/([A-Za-z0-9]*)([\/\?])?/)

  return false if match.nil?

  Prelaunch::valid? match[1]
end