Class: Gitlab::ZoomLinkExtractor
- Inherits:
-
Object
- Object
- Gitlab::ZoomLinkExtractor
- Defined in:
- lib/gitlab/zoom_link_extractor.rb
Constant Summary collapse
- ZOOM_REGEXP =
%r{https://(?:[\w-]+\.)?zoom\.us/(?:s|j|my)/\S+}
Instance Method Summary collapse
-
#initialize(text) ⇒ ZoomLinkExtractor
constructor
A new instance of ZoomLinkExtractor.
- #links ⇒ Object
- #match? ⇒ Boolean
Constructor Details
#initialize(text) ⇒ ZoomLinkExtractor
Returns a new instance of ZoomLinkExtractor.
13 14 15 |
# File 'lib/gitlab/zoom_link_extractor.rb', line 13 def initialize(text) @text = text.to_s end |
Instance Method Details
#links ⇒ Object
17 18 19 |
# File 'lib/gitlab/zoom_link_extractor.rb', line 17 def links @text.scan(ZOOM_REGEXP) end |
#match? ⇒ Boolean
21 22 23 |
# File 'lib/gitlab/zoom_link_extractor.rb', line 21 def match? ZOOM_REGEXP.match?(@text) end |