Class: ExternalIssue

Inherits:
Object
  • 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

#projectObject (readonly)

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

#hashObject


33
34
35
# File 'app/models/external_issue.rb', line 33

def hash
  [self.class, to_s].hash
end

#idObject


16
17
18
# File 'app/models/external_issue.rb', line 16

def id
  @issue_identifier.to_s
end

#iidObject


20
21
22
# File 'app/models/external_issue.rb', line 20

def iid
  @issue_identifier.to_s
end

#notesObject


51
52
53
# File 'app/models/external_issue.rb', line 51

def notes
  Note.none
end

#project_idObject


37
38
39
# File 'app/models/external_issue.rb', line 37

def project_id
  project.id
end

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

#titleObject


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_sObject


12
13
14
# File 'app/models/external_issue.rb', line 12

def to_s
  @issue_identifier.to_s
end