Class: Jiralicious::Version
- Defined in:
- lib/jiralicious/versions.rb
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.create(details) ⇒ Object
Creates a new version.
-
.move(key, options = {}) ⇒ Object
Moves the version to a new position.
-
.related_issue_counts(id) ⇒ Object
Returns the number of Issues associated with the Version.
-
.remove(key, options = {}) ⇒ Object
Removes/Deletes a Version from the Issue.
-
.unresolved_issue_count(id) ⇒ Object
Returns the number of Unresolved Issues associated with the Version.
-
.update(id, details) ⇒ Object
Updates a version.
Instance Method Summary collapse
-
#find ⇒ Object
Finds all versions based on the provided Issue Key.
-
#move(options = {}) ⇒ Object
Moves the version to a new position.
-
#related_issue_counts ⇒ Object
Returns the number of Issues associated with the Version.
-
#remove(options = {}) ⇒ Object
Removes/Deletes a Version from the Issue.
-
#unresolved_issue_count ⇒ Object
Returns the number of Unresolved Issues associated with the Version.
-
#update(details) ⇒ Object
Updates a version.
-
#version_key ⇒ Object
Holds the version Key.
Methods inherited from Field
Methods inherited from Base
#all, #endpoint_name, endpoint_name, fetch, find, find_all, handler, issueKey_test, #loaded?, #method_missing, #numeric?, parent_name, #parent_name, #properties_from_hash, #reload
Methods included from Parsers::FieldParser
Constructor Details
This class inherits a constructor from Jiralicious::Field
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Jiralicious::Base
Class Method Details
.create(details) ⇒ Object
Creates a new version
- Arguments
-
:details (required) Version details to be created
16 17 18 19 |
# File 'lib/jiralicious/versions.rb', line 16 def create(details) response = fetch({:method => :post, :body => details}) new(response.parsed_response) end |
.move(key, options = {}) ⇒ Object
Moves the version to a new position
- Arguments
-
:key (required) Version key
:options (optional) Hash of options
position
An absolute position, which may have a value of 'First', 'Last', 'Earlier' or 'Later'after
A version to place this version after. The value should be the self link of another version
34 35 36 37 38 39 |
# File 'lib/jiralicious/versions.rb', line 34 def move(key, = {}) if .include?(:position) [:position] = [:position].downcase.capitalize end fetch({:method => :post, :key => "#{key}/move", :body => }) end |
.related_issue_counts(id) ⇒ Object
Returns the number of Issues associated with the Version
- Arguments
-
:id (required) Version to count
59 60 61 62 63 |
# File 'lib/jiralicious/versions.rb', line 59 def (id) response = fetch({:key => "#{id}/relatedIssueCounts"}) response.parsed_response['key'] = id Field.new(response.parsed_response) end |
.remove(key, options = {}) ⇒ Object
Removes/Deletes a Version from the Issue
- Arguments
-
:key (required) Version key
:options (optional) Hash of options
49 50 51 |
# File 'lib/jiralicious/versions.rb', line 49 def remove(key, = {}) fetch({:method => :delete, :key => key, :body_to_params => true, :body => }).parsed_response end |
.unresolved_issue_count(id) ⇒ Object
Returns the number of Unresolved Issues associated with the Version
- Arguments
-
:id (required) Version to count
84 85 86 87 88 |
# File 'lib/jiralicious/versions.rb', line 84 def unresolved_issue_count(id) response = fetch({:key => "#{id}/unresolvedIssueCount"}) response.parsed_response['key'] = id Field.new(response.parsed_response) end |
.update(id, details) ⇒ Object
Updates a version
- Arguments
-
:id (required) Version to be updated
:details (required) Details of the version to be updated
73 74 75 76 |
# File 'lib/jiralicious/versions.rb', line 73 def update(id, details) response = fetch({:method => :put, :key => id, :body => details}) new(response.parsed_response) end |
Instance Method Details
#find ⇒ Object
Finds all versions based on the provided Issue Key
94 95 96 |
# File 'lib/jiralicious/versions.rb', line 94 def find self.class.find(self.version_key) end |
#move(options = {}) ⇒ Object
Moves the version to a new position
- Arguments
-
:options (optional) Hash of options
position
An absolute position, which may have a value of 'First', 'Last', 'Earlier' or 'Later'after
A version to place this version after. The value should be the self link of another version
109 110 111 |
# File 'lib/jiralicious/versions.rb', line 109 def move( = {}) self.class.move(self.version_key, ) end |
#related_issue_counts ⇒ Object
Returns the number of Issues associated with the Version
126 127 128 |
# File 'lib/jiralicious/versions.rb', line 126 def self.class.(self.version_key) end |
#remove(options = {}) ⇒ Object
Removes/Deletes a Version from the Issue
- Arguments
-
:options (optional) Hash of options
119 120 121 |
# File 'lib/jiralicious/versions.rb', line 119 def remove( = {}) self.class.remove(self.version_key, ) end |
#unresolved_issue_count ⇒ Object
Returns the number of Unresolved Issues associated with the Version
146 147 148 |
# File 'lib/jiralicious/versions.rb', line 146 def unresolved_issue_count self.class.unresolved_issue_count(self.version_key).issuesUnresolvedCount end |
#update(details) ⇒ Object
Updates a version
- Arguments
-
:details (required) Details of the version to be updated
136 137 138 139 140 141 |
# File 'lib/jiralicious/versions.rb', line 136 def update(details) details.each do |k, v| self.send("#{k.to_s}=", v) end self.class.update(self.version_key, details) end |
#version_key ⇒ Object
Holds the version Key
7 |
# File 'lib/jiralicious/versions.rb', line 7 property :version_key, :from => :id |