Class: MetaProject::Tracker::Issue
- Inherits:
-
Object
- Object
- MetaProject::Tracker::Issue
- 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
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#close(user_name, password) ⇒ Object
Closes the issue (adding a comment consisting of the
detail
). -
#create(user_name, password) ⇒ Object
Creates a new issue (consisting of the
summary
anddetail
). -
#detail ⇒ Object
The details of the issue (typically several lines).
-
#identifier ⇒ Object
The id of the issue in the tracker.
-
#initialize(tracker, attributes = {}) ⇒ Issue
constructor
A new instance of Issue.
-
#summary ⇒ Object
The summary of the issue (typically a one-liner).
-
#update(user_name, password) ⇒ Object
Adds a comment (consisting of the
detail
) to the issue. -
#url ⇒ Object
An URL pointing to the issue in the associated tracker, or nil if the issue doesn’t exist.
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
#attributes ⇒ Object (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 |
#detail ⇒ Object
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 |
#identifier ⇒ Object
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 |
#summary ⇒ Object
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 |
#url ⇒ Object
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 |