Class: Gitlab::ZoomLinkExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/zoom_link_extractor.rb

Constant Summary collapse

ZOOM_REGEXP =
%r{https://(?:[\w-]+\.)?zoom\.us/(?:s|j|my)/\S+}.freeze

Instance Method Summary collapse

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


17
18
19
# File 'lib/gitlab/zoom_link_extractor.rb', line 17

def links
  @text.scan(ZOOM_REGEXP)
end

#match?Boolean

Returns:

  • (Boolean)

21
22
23
# File 'lib/gitlab/zoom_link_extractor.rb', line 21

def match?
  ZOOM_REGEXP.match?(@text)
end