Class: TFS::WorkItems
Constant Summary collapse
- InvalidRecord =
Class.new(StandardError)
- REQUIRED_PARAMS =
[ "Title", "Type", "Project", "Description" ]
Constants inherited from Queryable
Constants included from ClassHelpers
Class Method Summary collapse
-
.find(id) ⇒ Object
Changeset can be found by id alone.
- .save(item) ⇒ Object
- .update(item) ⇒ Object
Methods inherited from Queryable
Methods included from ClassHelpers
#base_class, #method_name_from_class, #odata_class_from_method_name
Class Method Details
.find(id) ⇒ Object
Changeset can be found by id alone
TFS::Changeset.find(123)
17 18 19 |
# File 'lib/tfs/work_items.rb', line 17 def find(id) TFS.workitems(id).run.first end |
.save(item) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/tfs/work_items.rb', line 21 def save(item) REQUIRED_PARAMS.each do |param| raise InvalidRecord, "Missing required parameter '#{param}'" if item.send(param).nil? end client.AddToWorkItems(item) item = client.save_changes item.first end |
.update(item) ⇒ Object
31 32 33 34 |
# File 'lib/tfs/work_items.rb', line 31 def update(item) client.update_object(item) client.save_changes end |