Class: MetaProject::Tracker::Issue

Inherits:
Object
  • Object
show all
Defined in:
lib/meta_project/tracker/issue.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tracker, attributes = {}) ⇒ Issue

Returns a new instance of Issue.



6
7
8
9
# File 'lib/meta_project/tracker/issue.rb', line 6

def initialize(tracker, attributes={})
  @tracker = tracker
  @attributes = attributes
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



4
5
6
# File 'lib/meta_project/tracker/issue.rb', line 4

def attributes
  @attributes
end

Instance Method Details

#closeObject

Closes the issue (adding a comment consisting of the detail)



48
49
50
# File 'lib/meta_project/tracker/issue.rb', line 48

def close
  @tracker.close(self)
end

#createObject

Creates a new issue (consisting of the summary and detail)



43
44
45
# File 'lib/meta_project/tracker/issue.rb', line 43

def create
  @tracker.create(self)
end

#detailObject

The details of the issue (typically several lines) NOTE: This may be currently be nil for some trackers.



32
33
34
35
# File 'lib/meta_project/tracker/issue.rb', line 32

def detail
  @tracker.materialize(self) unless @attributes[:detail]
  @attributes[:detail]
end

#identifierObject

The id of the issue in the tracker



19
20
21
22
# File 'lib/meta_project/tracker/issue.rb', line 19

def identifier
  @tracker.materialize(self) unless @attributes[:identifier]
  @attributes[:identifier]
end

#summaryObject

The summary of the issue (typically a one-liner)



25
26
27
28
# File 'lib/meta_project/tracker/issue.rb', line 25

def summary
  @tracker.materialize(self) unless @attributes[:summary]
  @attributes[:summary]
end

#updateObject

Adds a comment (consisting of the detail) to the issue



38
39
40
# File 'lib/meta_project/tracker/issue.rb', line 38

def update
  @tracker.update(self)
end

#urlObject

An URL pointing to the issue in the associated tracker, or nil if the issue doesn’t exist.



13
14
15
16
# File 'lib/meta_project/tracker/issue.rb', line 13

def url
  @tracker.materialize(self) unless @attributes[:url]
  @attributes[:url]
end