Class: VSTS::Item
Overview
Item model
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#url ⇒ Object
Returns the value of attribute url.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#get(opts = {}) ⇒ String
Download TFVC item (ie. the file itself) See https://www.visualstudio.com/en-us/docs/integrate/api/tfvc/items#get-a-file See https://www.visualstudio.com/en-us/docs/integrate/api/tfvc/items#get-a-specific-version.
-
#initialize(h = {}) ⇒ Item
constructor
Create new item instance from a hash See https://www.visualstudio.com/en-us/docs/integrate/api/tfvc/changesets#get-list-of-changes-in-a-changeset.
Methods inherited from BaseModel
Constructor Details
#initialize(h = {}) ⇒ Item
Create new item instance from a hash See https://www.visualstudio.com/en-us/docs/integrate/api/tfvc/changesets#get-list-of-changes-in-a-changeset
11 12 13 14 15 |
# File 'lib/vsts/item.rb', line 11 def initialize(h = {}) @version = h["version"] @path = h["path"] @url = h["url"] end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/vsts/item.rb', line 5 def path @path end |
#url ⇒ Object
Returns the value of attribute url.
5 6 7 |
# File 'lib/vsts/item.rb', line 5 def url @url end |
#version ⇒ Object
Returns the value of attribute version.
5 6 7 |
# File 'lib/vsts/item.rb', line 5 def version @version end |
Instance Method Details
#get(opts = {}) ⇒ String
Download TFVC item (ie. the file itself) See https://www.visualstudio.com/en-us/docs/integrate/api/tfvc/items#get-a-file See https://www.visualstudio.com/en-us/docs/integrate/api/tfvc/items#get-a-specific-version
27 28 29 30 31 32 |
# File 'lib/vsts/item.rb', line 27 def get(opts = {}) urlparams = APIClient.build_params(opts, [:versionType, :version, :versionOptions]) urlparams[:path] = @path resp = APIClient.get("/items", area: "tfvc", urlparams: urlparams, accept: "application/binary") resp.body end |