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
|
# File 'app/models/external_issue.rb', line 8
def initialize(issue_identifier, project)
@issue_identifier, @project = issue_identifier, 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?
28
29
30
|
# File 'app/models/external_issue.rb', line 28
def ==(other)
other.is_a?(self.class) && (to_s == other.to_s)
end
|
#hash ⇒ Object
33
34
35
|
# File 'app/models/external_issue.rb', line 33
def hash
[self.class, to_s].hash
end
|
#id ⇒ Object
16
17
18
|
# File 'app/models/external_issue.rb', line 16
def id
@issue_identifier.to_s
end
|
#iid ⇒ Object
20
21
22
|
# File 'app/models/external_issue.rb', line 20
def iid
@issue_identifier.to_s
end
|
#notes ⇒ Object
51
52
53
|
# File 'app/models/external_issue.rb', line 51
def notes
Note.none
end
|
#project_id ⇒ Object
37
38
39
|
# File 'app/models/external_issue.rb', line 37
def project_id
project.id
end
|
#reference_link_text(from = nil) ⇒ Object
45
46
47
48
49
|
# File 'app/models/external_issue.rb', line 45
def reference_link_text(from = nil)
return "##{id}" if id =~ /^\d+$/
id
end
|
#title ⇒ Object
24
25
26
|
# File 'app/models/external_issue.rb', line 24
def title
"External Issue #{self}"
end
|
#to_reference(_from = nil, full: nil) ⇒ Object
41
42
43
|
# File 'app/models/external_issue.rb', line 41
def to_reference(_from = nil, full: nil)
reference_link_text
end
|
#to_s ⇒ Object
12
13
14
|
# File 'app/models/external_issue.rb', line 12
def to_s
@issue_identifier.to_s
end
|