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
11
# File 'app/models/external_issue.rb', line 8

def initialize(issue_identifier, project)
  @issue_identifier = issue_identifier
  @project = 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?


29
30
31
# File 'app/models/external_issue.rb', line 29

def ==(other)
  other.is_a?(self.class) && (to_s == other.to_s)
end

#hashObject


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

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

#idObject


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

def id
  @issue_identifier.to_s
end

#iidObject


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

def iid
  @issue_identifier.to_s
end

#notesObject


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

def notes
  Note.none
end

#project_idObject


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

def project_id
  project.id
end

46
47
48
49
50
# File 'app/models/external_issue.rb', line 46

def reference_link_text(from = nil)
  return "##{id}" if id =~ /^\d+$/

  id
end

#titleObject


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_sObject


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

def to_s
  @issue_identifier.to_s
end