Class: Playwright::UrlMatcher
- Inherits:
-
Object
- Object
- Playwright::UrlMatcher
- Defined in:
- lib/playwright/url_matcher.rb
Instance Method Summary collapse
-
#initialize(url) ⇒ UrlMatcher
constructor
A new instance of UrlMatcher.
- #match?(target_url) ⇒ Boolean
Constructor Details
#initialize(url) ⇒ UrlMatcher
Returns a new instance of UrlMatcher.
4 5 6 |
# File 'lib/playwright/url_matcher.rb', line 4 def initialize(url) @url = url end |
Instance Method Details
#match?(target_url) ⇒ Boolean
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/playwright/url_matcher.rb', line 8 def match?(target_url) case @url when String @url == target_url when Regexp @url.match?(target_url) else false end end |