Class: Redminer::Issue
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#category ⇒ Object
Returns the value of attribute category.
-
#created_on ⇒ Object
Returns the value of attribute created_on.
-
#description ⇒ Object
Returns the value of attribute description.
-
#due_date ⇒ Object
Returns the value of attribute due_date.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#project ⇒ Object
Returns the value of attribute project.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#status ⇒ Object
Returns the value of attribute status.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#tracker ⇒ Object
Returns the value of attribute tracker.
-
#updated_on ⇒ Object
Returns the value of attribute updated_on.
Attributes inherited from Base
Instance Method Summary collapse
- #craete ⇒ Object
-
#initialize(server, id = nil) ⇒ Issue
constructor
A new instance of Issue.
- #retrieve ⇒ Object
- #sync ⇒ Object
- #update(note = nil) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(server, id = nil) ⇒ Issue
Returns a new instance of Issue.
10 11 12 13 14 15 16 |
# File 'lib/redminer/issue.rb', line 10 def initialize(server, id = nil) @server = server unless id.nil? @id = id self.retrieve end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Redminer::Base
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
4 5 6 |
# File 'lib/redminer/issue.rb', line 4 def @author end |
#category ⇒ Object
Returns the value of attribute category.
4 5 6 |
# File 'lib/redminer/issue.rb', line 4 def category @category end |
#created_on ⇒ Object
Returns the value of attribute created_on.
4 5 6 |
# File 'lib/redminer/issue.rb', line 4 def created_on @created_on end |
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/redminer/issue.rb', line 4 def description @description end |
#due_date ⇒ Object
Returns the value of attribute due_date.
4 5 6 |
# File 'lib/redminer/issue.rb', line 4 def due_date @due_date end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/redminer/issue.rb', line 3 def id @id end |
#priority ⇒ Object
Returns the value of attribute priority.
4 5 6 |
# File 'lib/redminer/issue.rb', line 4 def priority @priority end |
#project ⇒ Object
Returns the value of attribute project.
4 5 6 |
# File 'lib/redminer/issue.rb', line 4 def project @project end |
#start_date ⇒ Object
Returns the value of attribute start_date.
4 5 6 |
# File 'lib/redminer/issue.rb', line 4 def start_date @start_date end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/redminer/issue.rb', line 4 def status @status end |
#subject ⇒ Object
Returns the value of attribute subject.
4 5 6 |
# File 'lib/redminer/issue.rb', line 4 def subject @subject end |
#tracker ⇒ Object
Returns the value of attribute tracker.
4 5 6 |
# File 'lib/redminer/issue.rb', line 4 def tracker @tracker end |
#updated_on ⇒ Object
Returns the value of attribute updated_on.
4 5 6 |
# File 'lib/redminer/issue.rb', line 4 def updated_on @updated_on end |
Instance Method Details
#craete ⇒ Object
30 31 32 |
# File 'lib/redminer/issue.rb', line 30 def craete server.post("/issues.json", to_hash) end |
#retrieve ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/redminer/issue.rb', line 18 def retrieve response = server.get("/issues/#{id}.json") raise "#{id} issue does not exists" if response.nil? origin = response["issue"] self.all = origin self end |
#sync ⇒ Object
26 27 28 |
# File 'lib/redminer/issue.rb', line 26 def sync (@id.nil? ? create : update) end |
#update(note = nil) ⇒ Object
34 35 36 37 |
# File 'lib/redminer/issue.rb', line 34 def update(note = nil) params = to_hash.merge(:notes => note) unless note.nil? server.put("/issues/#{id}.json", params) end |