Class: Atlassian::JiraIssueKeyExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/atlassian/jira_issue_key_extractor.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*text) ⇒ JiraIssueKeyExtractor

Returns a new instance of JiraIssueKeyExtractor.


9
10
11
# File 'lib/atlassian/jira_issue_key_extractor.rb', line 9

def initialize(*text)
  @text = text.join(' ')
end

Class Method Details

.has_keys?(*text) ⇒ Boolean

Returns:

  • (Boolean)

5
6
7
# File 'lib/atlassian/jira_issue_key_extractor.rb', line 5

def self.has_keys?(*text)
  new(*text).issue_keys.any?
end

Instance Method Details

#issue_keysObject


13
14
15
# File 'lib/atlassian/jira_issue_key_extractor.rb', line 13

def issue_keys
  @text.scan(Gitlab::Regex.jira_issue_key_regex).uniq
end