Class: MetaProject::Tracker::Issue

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

Overview

An issue represents an entry in an issue tracker such as a bug report or feature request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Issue.



9
10
11
12
# File 'lib/meta_project/tracker/issue.rb', line 9

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

Instance Method Details

#close(user_name, password) ⇒ Object

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



52
53
54
# File 'lib/meta_project/tracker/issue.rb', line 52

def close(user_name, password)
  @tracker.close(self, user_name, password)
end

#create(user_name, password) ⇒ Object

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



45
46
47
48
49
# File 'lib/meta_project/tracker/issue.rb', line 45

def create(user_name, password)
  raise "Summary not set" unless summary
  raise "Detail not set" unless detail
  @tracker.create(self, user_name, password)
end

#detailObject

The details of the issue (typically several lines)



34
35
36
37
# File 'lib/meta_project/tracker/issue.rb', line 34

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

#identifierObject

The id of the issue in the tracker



22
23
24
25
# File 'lib/meta_project/tracker/issue.rb', line 22

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

#summaryObject

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



28
29
30
31
# File 'lib/meta_project/tracker/issue.rb', line 28

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

#update(user_name, password) ⇒ Object

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



40
41
42
# File 'lib/meta_project/tracker/issue.rb', line 40

def update(user_name, password)
  @tracker.update(self, user_name, password)
end

#urlObject

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



16
17
18
19
# File 'lib/meta_project/tracker/issue.rb', line 16

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