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.
48 49 50 51 52 53 |
# File 'lib/phabricator/maniphest/task.rb', line 48 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.
29 30 31 |
# File 'lib/phabricator/maniphest/task.rb', line 29 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
28 29 30 |
# File 'lib/phabricator/maniphest/task.rb', line 28 def id @id end |
#priority ⇒ Object
Returns the value of attribute priority.
29 30 31 |
# File 'lib/phabricator/maniphest/task.rb', line 29 def priority @priority end |
#title ⇒ Object
Returns the value of attribute title.
29 30 31 |
# File 'lib/phabricator/maniphest/task.rb', line 29 def title @title end |
Class Method Details
.create(title, description = nil, projects = [], priority = 'normal', owner = nil, ccs = [], other = {}) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/phabricator/maniphest/task.rb', line 31 def self.create(title, description=nil, projects=[], priority='normal', owner=nil, ccs=[], 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 }, ownerPHID: owner ? Phabricator::User.find_by_name(owner).phid : nil, ccPHIDs: ccs.map {|c| Phabricator::User.find_by_name(c).phid } }.merge(other))) data = response['result'] # TODO: Error handling self.new(data) end |