class DeviseJwtAuth::Url::Wildcat
wildcard convenience class
Public Class Methods
new(str)
click to toggle source
# File lib/devise_jwt_auth/url.rb, line 34 def initialize(str) @regex = self.class.parse_to_regex(str) end
parse_to_regex(str)
click to toggle source
# File lib/devise_jwt_auth/url.rb, line 29 def self.parse_to_regex(str) escaped = Regexp.escape(str).gsub('\*', '.*?') Regexp.new("^#{escaped}$", Regexp::IGNORECASE) end
Public Instance Methods
match(str)
click to toggle source
# File lib/devise_jwt_auth/url.rb, line 38 def match(str) !!@regex.match(str) end