Class: Hookers::Changelog::Matchers::ServiceNowMatcher
- Inherits:
-
Matcher
- Object
- Matcher
- Hookers::Changelog::Matchers::ServiceNowMatcher
show all
- Defined in:
- lib/hookers/changelog/matchers.rb
Constant Summary
Constants inherited
from Matcher
Matcher::SUBPATTERN
Instance Attribute Summary
Attributes inherited from Matcher
#commit, #number
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Matcher
blocks_of, #initialize, #to_affected
Class Method Details
.scan(commit) ⇒ Object
52
53
54
|
# File 'lib/hookers/changelog/matchers.rb', line 52
def self.scan(commit)
blocks_of(commit, /(INC|PRB|TICKET|CHG)(\d+)/).map { |e| new(commit, *e) }
end
|
Instance Method Details
#identifier ⇒ Object
66
67
68
|
# File 'lib/hookers/changelog/matchers.rb', line 66
def identifier
"#{@type}#{number}"
end
|
#type ⇒ Object
62
63
64
|
# File 'lib/hookers/changelog/matchers.rb', line 62
def type
{"chg" => "CHANGE"}.fetch(@type.to_s.downcase, @type.to_s)
end
|
#uri ⇒ Object
56
57
58
59
60
|
# File 'lib/hookers/changelog/matchers.rb', line 56
def uri
uris = {"chg" => "change_request_list", "inc" => "incident_list", "prb" => "problem_list"}
"https://lwprod.service-now.com/nav_to.do?uri=#{uris.fetch(@type.to_s.downcase)}.do?sysparm_query=number%3D#{identifier}"
end
|