Class: ExternalIssue
- Inherits:
-
Object
show all
- Includes:
- Referable
- Defined in:
- app/models/external_issue.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Referable
#referable_inspect, #to_reference_base
Constructor Details
#initialize(issue_identifier, project) ⇒ ExternalIssue
Returns a new instance of ExternalIssue.
8
9
10
11
|
# File 'app/models/external_issue.rb', line 8
def initialize(issue_identifier, project)
@issue_identifier = issue_identifier
@project = project
end
|
Instance Attribute Details
#project ⇒ Object
Returns the value of attribute project.
6
7
8
|
# File 'app/models/external_issue.rb', line 6
def project
@project
end
|
Instance Method Details
#==(other) ⇒ Object
Also known as:
eql?
29
30
31
|
# File 'app/models/external_issue.rb', line 29
def ==(other)
other.is_a?(self.class) && (to_s == other.to_s)
end
|
#hash ⇒ Object
34
35
36
|
# File 'app/models/external_issue.rb', line 34
def hash
[self.class, to_s].hash
end
|
#id ⇒ Object
17
18
19
|
# File 'app/models/external_issue.rb', line 17
def id
@issue_identifier.to_s
end
|
#iid ⇒ Object
21
22
23
|
# File 'app/models/external_issue.rb', line 21
def iid
@issue_identifier.to_s
end
|
#notes ⇒ Object
52
53
54
|
# File 'app/models/external_issue.rb', line 52
def notes
Note.none
end
|
#project_id ⇒ Object
38
39
40
|
# File 'app/models/external_issue.rb', line 38
def project_id
project.id
end
|
#reference_link_text(from = nil) ⇒ Object
46
47
48
49
50
|
# File 'app/models/external_issue.rb', line 46
def reference_link_text(from = nil)
return "##{id}" if /^\d+$/.match?(id)
id
end
|
#title ⇒ Object
25
26
27
|
# File 'app/models/external_issue.rb', line 25
def title
"External Issue #{self}"
end
|
#to_reference(_from = nil, full: nil) ⇒ Object
42
43
44
|
# File 'app/models/external_issue.rb', line 42
def to_reference(_from = nil, full: nil)
reference_link_text
end
|
#to_s ⇒ Object
13
14
15
|
# File 'app/models/external_issue.rb', line 13
def to_s
@issue_identifier.to_s
end
|