2015-04-26 12:48:37 +05:30
|
|
|
class ExternalIssue
|
2015-09-11 14:41:01 +05:30
|
|
|
include Referable
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
def initialize(issue_identifier, project)
|
|
|
|
@issue_identifier, @project = issue_identifier, project
|
|
|
|
end
|
|
|
|
|
|
|
|
def to_s
|
|
|
|
@issue_identifier.to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
def id
|
|
|
|
@issue_identifier.to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
def iid
|
|
|
|
@issue_identifier.to_s
|
|
|
|
end
|
|
|
|
|
2015-09-11 14:41:01 +05:30
|
|
|
def title
|
|
|
|
"External Issue #{self}"
|
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
def ==(other)
|
|
|
|
other.is_a?(self.class) && (to_s == other.to_s)
|
|
|
|
end
|
|
|
|
|
|
|
|
def project
|
|
|
|
@project
|
|
|
|
end
|
2015-09-11 14:41:01 +05:30
|
|
|
|
|
|
|
def to_reference(_from_project = nil)
|
|
|
|
id
|
|
|
|
end
|
2016-06-02 11:05:42 +05:30
|
|
|
|
|
|
|
def reference_link_text(from_project = nil)
|
|
|
|
return "##{id}" if /^\d+$/.match(id)
|
|
|
|
|
|
|
|
id
|
|
|
|
end
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|