Class: Phabricator::Maniphest::Task
- Inherits:
-
Object
- Object
- Phabricator::Maniphest::Task
- Defined in:
- lib/phabricator/maniphest/task.rb
Defined Under Namespace
Modules: Priority
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Task
constructor
A new instance of Task.
Constructor Details
#initialize(attributes) ⇒ Task
Returns a new instance of Task.
44 45 46 47 48 49 |
# File 'lib/phabricator/maniphest/task.rb', line 44 def initialize(attributes) @id = attributes['id'] @title = attributes['title'] @description = attributes['description'] @priority = attributes['priority'] end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
27 28 29 |
# File 'lib/phabricator/maniphest/task.rb', line 27 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
26 27 28 |
# File 'lib/phabricator/maniphest/task.rb', line 26 def id @id end |
#priority ⇒ Object
Returns the value of attribute priority.
27 28 29 |
# File 'lib/phabricator/maniphest/task.rb', line 27 def priority @priority end |
#title ⇒ Object
Returns the value of attribute title.
27 28 29 |
# File 'lib/phabricator/maniphest/task.rb', line 27 def title @title end |
Class Method Details
.create(title, description = nil, projects = [], priority = 'normal', other = {}) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/phabricator/maniphest/task.rb', line 29 def self.create(title, description=nil, projects=[], priority='normal', other={}) response = JSON.parse(client.request(:post, 'maniphest.createtask', { title: title, description: description, priority: Priority.send(priority), projectPHIDs: projects.map {|p| Phabricator::Project.find_by_name(p).phid } }.merge(other))) data = response['result'] # TODO: Error handling self.new(data) end |